From 1b8afd22486fbdd07c031009556ed700ebb77c3a Mon Sep 17 00:00:00 2001 From: crockwave Date: Thu, 17 Sep 2020 17:33:18 -0500 Subject: [PATCH] Convert newline delimited data to space delimited data --- app/soapbox/actions/import_follows.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/soapbox/actions/import_follows.js b/app/soapbox/actions/import_follows.js index 7d794dfd0..c2b256e4c 100644 --- a/app/soapbox/actions/import_follows.js +++ b/app/soapbox/actions/import_follows.js @@ -4,11 +4,16 @@ export const IMPORT_FOLLOWS_REQUEST = 'IMPORT_FOLLOWS_REQUEST'; export const IMPORT_FOLLOWS_SUCCESS = 'IMPORT_FOLLOWS_SUCCESS'; export const IMPORT_FOLLOWS_FAIL = 'IMPORT_FOLLOWS_FAIL'; +function whiteSpace(params) { + const follows = params.replace(/\n/g, ' '); + return follows; +}; + export function importFollows(params) { return (dispatch, getState) => { dispatch({ type: IMPORT_FOLLOWS_REQUEST }); return api(getState) - .post('/api/pleroma/follow_import', params) + .post('/api/pleroma/follow_import', whiteSpace(params)) .then(response => { dispatch({ type: IMPORT_FOLLOWS_SUCCESS, config: response.data }); }).catch(error => {