feat: implement leave search space functionality for non-owners and update related UI components

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-01-13 02:06:35 -08:00
parent 6622a8c582
commit d140f6393e
6 changed files with 154 additions and 49 deletions

View file

@ -11,6 +11,7 @@ import {
getSearchSpaceResponse,
getSearchSpacesRequest,
getSearchSpacesResponse,
leaveSearchSpaceResponse,
type UpdateSearchSpaceRequest,
updateSearchSpaceRequest,
updateSearchSpaceResponse,
@ -115,6 +116,17 @@ class SearchSpacesApiService {
return baseApiService.delete(`/api/v1/searchspaces/${request.id}`, deleteSearchSpaceResponse);
};
/**
* Leave a search space (remove own membership)
* This is used by non-owners to leave a shared search space
*/
leaveSearchSpace = async (searchSpaceId: number) => {
return baseApiService.delete(
`/api/v1/searchspaces/${searchSpaceId}/members/me`,
leaveSearchSpaceResponse
);
};
}
export const searchSpacesApiService = new SearchSpacesApiService();