Skip to content

Commit

Permalink
feature: remove redundant code [WTEL-4354]
Browse files Browse the repository at this point in the history
  • Loading branch information
lizacoma committed Apr 15, 2024
1 parent e597c1b commit d99f42d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ const getTeamSchemesList = async (params) => {
}
};

const getTeamSchemes = async ({ parentId, itemId: id }) => {

const getTeamScheme = async ({ parentId, itemId: id }) => {
const defaultObject = {
name: '',
description: '',
Expand All @@ -91,7 +90,7 @@ const getTeamSchemes = async ({ parentId, itemId: id }) => {
}
};

const addTeamSchemes = async ({ parentId, itemInstance }) => {
const addTeamScheme = async ({ parentId, itemInstance }) => {
const item = applyTransform(itemInstance, [
preRequestHandler(parentId),
sanitize(fieldsToSend),
Expand All @@ -109,7 +108,7 @@ const addTeamSchemes = async ({ parentId, itemInstance }) => {
}
};

const patchTeamSchemes = async ({ changes, id, parentId }) => {
const patchTeamScheme = async ({ changes, id, parentId }) => {
const body = applyTransform(changes, [
sanitize(fieldsToSend),
camelToSnake(),
Expand All @@ -127,7 +126,7 @@ const patchTeamSchemes = async ({ changes, id, parentId }) => {
}
};

const updateTeamSchemes = async ({ itemInstance, itemId: id, parentId }) => {
const updateTeamScheme = async ({ itemInstance, itemId: id, parentId }) => {
const item = applyTransform(itemInstance, [
preRequestHandler(parentId),
sanitize(fieldsToSend),
Expand All @@ -145,7 +144,7 @@ const updateTeamSchemes = async ({ itemInstance, itemId: id, parentId }) => {
}
};

const deleteTeamSchemes = async ({ parentId, id }) => {
const deleteTeamScheme = async ({ parentId, id }) => {
try {
const response = await schemeService.deleteTeamTrigger(parentId, id);
return applyTransform(response.data, []);
Expand All @@ -158,11 +157,11 @@ const deleteTeamSchemes = async ({ parentId, id }) => {

const TeamAgentsAPI = {
getList: getTeamSchemesList,
get: getTeamSchemes,
add: addTeamSchemes,
update: updateTeamSchemes,
patch: patchTeamSchemes,
delete: deleteTeamSchemes,
get: getTeamScheme,
add: addTeamScheme,
update: updateTeamScheme,
patch: patchTeamScheme,
delete: deleteTeamScheme,
};

export default TeamAgentsAPI;
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,11 @@
sortable
@sort="sort"
>
<template #event="{ item }">
{{ item.event }}
</template>
<template #schema="{ item }">
{{ item.schema.name }}
</template>
<template #state="{ item, index }">
<wt-switcher
:disabled="!hasEditAccess"
:value="item.enabled"
@change="patchItem({ item, index, prop: 'enabled', value: $event })"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default [
{
value: 'state',
locale: 'reusable.state',
// field: 'enabled',
field: 'enabled',
sort: SortSymbols.NONE,
},
];

0 comments on commit d99f42d

Please sign in to comment.