Convert newline delimited data to space delimited data

chats_paste
crockwave 2020-09-17 17:33:18 -05:00
rodzic fdc1a051d3
commit 1b8afd2248
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -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 => {