Spaces:
Sleeping
Sleeping
Download backend/src/controllers/dashboard.controller.ts from cuteepeiarchu/PathFinders: direct link, hf CLI and curl.
- Browser
- Download file 552 Bytes
-
https://huggingface.co/spaces/cuteepeiarchu/PathFinders/resolve/main/backend/src/controllers/dashboard.controller.ts
- Command line
-
hf download hf://spaces/cuteepeiarchu/PathFinders/backend/src/controllers/dashboard.controller.ts
-
curl -L -o dashboard.controller.ts https://huggingface.co/spaces/cuteepeiarchu/PathFinders/resolve/main/backend/src/controllers/dashboard.controller.ts
552 Bytes
| import { NextFunction, Request, Response } from "express"; | |
| import { dashboardService } from "../services/dashboard.service"; | |
| import { AppError } from "../utils/appError"; | |
| export const dashboardController = { | |
| overview(request: Request, response: Response, next: NextFunction) { | |
| try { | |
| if (!request.authUserId) { | |
| throw new AppError("Unauthorized.", 401); | |
| } | |
| const data = dashboardService.getOverview(request.authUserId); | |
| response.json({ success: true, data }); | |
| } catch (error) { | |
| next(error); | |
| } | |
| }, | |
| }; | |