Download apps/readest-app/src/libs/user.ts from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/libs/user.ts
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/libs/user.ts
-
curl -L -o user.ts https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/libs/user.ts
555 Bytes
| import { getAPIBaseUrl } from '@/services/environment'; | |
| import { getUserID } from '@/utils/access'; | |
| import { fetchWithAuth } from '@/utils/fetch'; | |
| const API_ENDPOINT = getAPIBaseUrl() + '/user/delete'; | |
| export const deleteUser = async () => { | |
| try { | |
| const userId = await getUserID(); | |
| if (!userId) { | |
| throw new Error('Not authenticated'); | |
| } | |
| await fetchWithAuth(API_ENDPOINT, { | |
| method: 'DELETE', | |
| }); | |
| } catch (error) { | |
| console.error('User deletion failed:', error); | |
| throw new Error('User deletion failed'); | |
| } | |
| }; | |