chore fix

This commit is contained in:
jey-exp 2025-03-06 00:41:44 +05:30
parent b751ade3d8
commit bc3a20e1f6
2 changed files with 12 additions and 25 deletions

View file

@ -14,34 +14,22 @@ export async function deleteCollection(
collection_uuid: any,
access_token: any
) {
const = toast.loading("Deleting collection...")
try {
const result: any = await fetch(
`${getAPIUrl()}collections/${collection_uuid}`,
RequestBodyWithAuthHeader('DELETE', null, null, access_token)
)
toast.success("Deleted colletion", {id:})
const res = await errorHandling(result)
return res
} catch (error) {
toast.error("Couldn't delete collection", {id:})
}
}
// Create a new collection
export async function createCollection(collection: any, access_token: any) {
const = toast.loading("Creating...")
try {
const result: any = await fetch(
`${getAPIUrl()}collections/`,
RequestBodyWithAuthHeader('POST', collection, null, access_token)
)
toast.success("New collection created", {id:})
const res = await errorHandling(result)
return res
} catch (error) {
toast.error("Couldn't create collection", {id:})
}
}
export async function getCollectionById(

View file

@ -4,7 +4,6 @@ import {
errorHandling,
getResponseMetadata,
} from '@services/utils/ts/requests'
import toast from 'react-hot-toast'
/*
This file includes only POST, PUT, DELETE requests