feat: Add feedback for administrator
This commit is contained in:
@@ -12,9 +12,30 @@ export interface AdminRouteItem {
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export type FeedbackType =
|
||||
| "TRUCK_DID_NOT_PASS"
|
||||
| "RATING"
|
||||
| "SUGGESTION"
|
||||
| "OTHER";
|
||||
|
||||
export interface AdminFeedbackItem {
|
||||
id: string;
|
||||
userId: number;
|
||||
routeId: string | null;
|
||||
userName?: string;
|
||||
colonia?: string;
|
||||
type: FeedbackType;
|
||||
message: string;
|
||||
rating?: number;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export const listAllRoutes = () =>
|
||||
apiFetch<AdminRouteItem[]>("/api/admin/routes");
|
||||
|
||||
export const listAllFeedback = () =>
|
||||
apiFetch<AdminFeedbackItem[]>("/api/admin/feedback");
|
||||
|
||||
export const cancelRoute = (routeId: string, reason?: string) =>
|
||||
apiFetch<{ message: string; routeId: string }>(
|
||||
`/api/admin/routes/${routeId}/cancel`,
|
||||
|
||||
Reference in New Issue
Block a user