Use new Collections endpoint version (#39214)

This commit is contained in:
diondiondion 2026-05-29 14:48:12 +02:00 committed by GitHub
parent fa1e16ed9f
commit a86f3a4000
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,48 +15,40 @@ import type {
} from '../api_types/collections';
export const apiCreateCollection = (collection: ApiCreateCollectionPayload) =>
apiRequestPost<ApiWrappedCollectionJSON>('v1_alpha/collections', collection);
apiRequestPost<ApiWrappedCollectionJSON>('v1/collections', collection);
export const apiUpdateCollection = ({
id,
...collection
}: ApiUpdateCollectionPayload) =>
apiRequestPut<ApiWrappedCollectionJSON>(
`v1_alpha/collections/${id}`,
collection,
);
apiRequestPut<ApiWrappedCollectionJSON>(`v1/collections/${id}`, collection);
export const apiDeleteCollection = (collectionId: string) =>
apiRequestDelete(`v1_alpha/collections/${collectionId}`);
apiRequestDelete(`v1/collections/${collectionId}`);
export const apiGetCollection = (collectionId: string) =>
apiRequestGet<ApiCollectionWithAccountsJSON>(
`v1_alpha/collections/${collectionId}`,
`v1/collections/${collectionId}`,
);
export const apiGetCollectionsCreatedByAccount = (accountId: string) =>
apiRequestGet<ApiCollectionsJSON>(
`v1_alpha/accounts/${accountId}/collections`,
);
apiRequestGet<ApiCollectionsJSON>(`v1/accounts/${accountId}/collections`);
export const apiGetCollectionsFeaturingAccount = (accountId: string) =>
apiRequestGet<ApiCollectionsJSON>(
`v1_alpha/accounts/${accountId}/in_collections`,
);
apiRequestGet<ApiCollectionsJSON>(`v1/accounts/${accountId}/in_collections`);
export const apiAddCollectionItem = (collectionId: string, accountId: string) =>
apiRequestPost<WrappedCollectionAccountItem>(
`v1_alpha/collections/${collectionId}/items`,
`v1/collections/${collectionId}/items`,
{ account_id: accountId },
);
export const apiRemoveCollectionItem = (collectionId: string, itemId: string) =>
apiRequestDelete<WrappedCollectionAccountItem>(
`v1_alpha/collections/${collectionId}/items/${itemId}`,
`v1/collections/${collectionId}/items/${itemId}`,
);
export const apiRevokeCollectionInclusion = (
collectionId: string,
itemId: string,
) =>
apiRequestPost(`v1_alpha/collections/${collectionId}/items/${itemId}/revoke`);
) => apiRequestPost(`v1/collections/${collectionId}/items/${itemId}/revoke`);