From 8a03e5526c759a91ee16f76e24f50cda04f4b10a Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Tue, 21 Mar 2023 10:18:48 +0200 Subject: [PATCH] Fix/remove settings post endpoint (#3356) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR removes the call the setDefaultProjectStickiness from EditProject. The value is part of the payload for the project ## About the changes Closes # ### Important files ## Discussion points --------- Signed-off-by: andreas-unleash --- .../project/Project/EditProject/EditProject.tsx | 7 ------- .../api/actions/useProjectApi/useProjectApi.ts | 15 --------------- 2 files changed, 22 deletions(-) diff --git a/frontend/src/component/project/Project/EditProject/EditProject.tsx b/frontend/src/component/project/Project/EditProject/EditProject.tsx index dd2dab6bc5..9276b33e54 100644 --- a/frontend/src/component/project/Project/EditProject/EditProject.tsx +++ b/frontend/src/component/project/Project/EditProject/EditProject.tsx @@ -24,7 +24,6 @@ const EditProject = () => { const { hasAccess } = useContext(AccessContext); const id = useRequiredPathParam('projectId'); const { project } = useProject(id); - const { setDefaultProjectStickiness } = useProjectApi(); const { defaultStickiness } = useDefaultProjectSettings(id); const navigate = useNavigate(); @@ -73,12 +72,6 @@ const EditProject = () => { if (validName) { try { await editProject(id, payload); - if (uiConfig?.flags?.projectScopedStickiness) { - await setDefaultProjectStickiness( - projectId, - payload.defaultStickiness - ); - } refetch(); navigate(`/projects/${id}`); setToastData({ diff --git a/frontend/src/hooks/api/actions/useProjectApi/useProjectApi.ts b/frontend/src/hooks/api/actions/useProjectApi/useProjectApi.ts index 9d251a1926..defca69ff6 100644 --- a/frontend/src/hooks/api/actions/useProjectApi/useProjectApi.ts +++ b/frontend/src/hooks/api/actions/useProjectApi/useProjectApi.ts @@ -203,20 +203,6 @@ const useProjectApi = () => { return makeRequest(req.caller, req.id); }; - - const setDefaultProjectStickiness = ( - projectId: string, - stickiness: string - ) => { - const path = `api/admin/projects/${projectId}/settings`; - const req = createRequest(path, { - method: 'POST', - body: JSON.stringify({ defaultStickiness: stickiness }), - }); - - return makeRequest(req.caller, req.id); - }; - const archiveFeatures = async (projectId: string, featureIds: string[]) => { const path = `api/admin/projects/${projectId}/archive`; const req = createRequest(path, { @@ -272,7 +258,6 @@ const useProjectApi = () => { reviveFeatures, staleFeatures, searchProjectUser, - setDefaultProjectStickiness, errors, loading, };