Skip to content

Commit

Permalink
refactor: api file changed due to codereview [WTEL-3717]
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirBeria committed Oct 20, 2023
1 parent 2417e3b commit ef9542f
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/modules/integrations/modules/single-sign-on/api/singleSignOn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import {
} from '@webitel/ui-sdk/src/api/defaults';
import applyTransform, {
camelToSnake,
merge, notify, snakeToCamel,
starToSearch, log, sanitize,
generateUrl, mergeEach,
generateUrl,
merge,
mergeEach,
notify,
sanitize,
snakeToCamel,
starToSearch,
} from '@webitel/ui-sdk/src/api/transformers';
import instance from '../../../../../app/api/instance';

Expand Down Expand Up @@ -43,7 +47,6 @@ const getSingleSignOnList = async (params) => {
};
} catch (err) {
throw applyTransform(err, [

notify,
]);
}
Expand Down Expand Up @@ -71,13 +74,21 @@ const getSingleSignOn = async ({ itemId: id }) => {
]);
} catch (err) {
throw applyTransform(err, [

notify,
]);
}
};

const fieldsToSend = ['name', 'type', 'id', 'clientId', 'clientSecret', 'discoveryUrl', 'enabled', 'scopes'];
const fieldsToSend = [
'name',
'type',
'id',
'clientId',
'clientSecret',
'discoveryUrl',
'enabled',
'scopes',
];

const addSingleSignOn = async ({ itemInstance }) => {
const item = applyTransform(itemInstance, [
Expand All @@ -91,7 +102,6 @@ const addSingleSignOn = async ({ itemInstance }) => {
]);
} catch (err) {
throw applyTransform(err, [

notify,
]);
}
Expand All @@ -110,7 +120,6 @@ const updateSingleSignOn = async ({ itemInstance, itemId: id }) => {
]);
} catch (err) {
throw applyTransform(err, [

notify,
]);
}
Expand All @@ -129,7 +138,6 @@ const patchSingleSignOn = async ({ changes, id }) => {
]);
} catch (err) {
throw applyTransform(err, [

notify,
]);
}
Expand All @@ -142,7 +150,6 @@ const deleteSingleSignOn = async ({ id }) => {
return applyTransform(response.data, []);
} catch (err) {
throw applyTransform(err, [

notify,
]);
}
Expand Down

0 comments on commit ef9542f

Please sign in to comment.