From bc3a20e1f641a4bfa8b6b26e8edba2f5f3d7d4da Mon Sep 17 00:00:00 2001 From: jey-exp Date: Thu, 6 Mar 2025 00:41:44 +0530 Subject: [PATCH] chore fix --- apps/web/services/courses/collections.ts | 36 ++++++++---------------- apps/web/services/settings/password.ts | 1 - 2 files changed, 12 insertions(+), 25 deletions(-) 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