[Glitch] Allow managing collection accounts

Port a644a4a762 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion authored and Claire committed 2026-02-17 12:15:31 +01:00
1 parent f47e2937cf
commit 9abfde6189
14 files changed
+584 -75

No files matched your search

@@ -11,6 +11,7 @@ import type {
ApiCreateCollectionPayload,
ApiUpdateCollectionPayload,
ApiCollectionsJSON,
WrappedCollectionAccountItem,
} from '../api_types/collections';
export const apiCreateCollection = (collection: ApiCreateCollectionPayload) =>
@@ -37,3 +38,14 @@ export const apiGetAccountCollections = (accountId: string) =>
apiRequestGet<ApiCollectionsJSON>(
`v1_alpha/accounts/${accountId}/collections`,
);
export const apiAddCollectionItem = (collectionId: string, accountId: string) =>
apiRequestPost<WrappedCollectionAccountItem>(
`v1_alpha/collections/${collectionId}/items`,
{ account_id: accountId },
);
export const apiRemoveCollectionItem = (collectionId: string, itemId: string) =>
apiRequestDelete<WrappedCollectionAccountItem>(
`v1_alpha/collections/${collectionId}/items/${itemId}`,
);