diff --git a/apps/web/services/courses/collections.ts b/apps/web/services/courses/collections.ts index 16b21801..097a8deb 100644 --- a/apps/web/services/courses/collections.ts +++ b/apps/web/services/courses/collections.ts @@ -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:}) - } + const result: any = await fetch( + `${getAPIUrl()}collections/${collection_uuid}`, + RequestBodyWithAuthHeader('DELETE', null, null, access_token) + ) + const res = await errorHandling(result) + return res } // 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:}) - } + const result: any = await fetch( + `${getAPIUrl()}collections/`, + RequestBodyWithAuthHeader('POST', collection, null, access_token) + ) + const res = await errorHandling(result) + return res } export async function getCollectionById( diff --git a/apps/web/services/settings/password.ts b/apps/web/services/settings/password.ts index c8e533d0..e580a616 100644 --- a/apps/web/services/settings/password.ts +++ b/apps/web/services/settings/password.ts @@ -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