Initial commit: SIBU 2.0 MISSION
This commit is contained in:
28
frontend/src/services/reportsService.ts
Normal file
28
frontend/src/services/reportsService.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { apiClient } from './apiClient';
|
||||
|
||||
export interface Report {
|
||||
id: string;
|
||||
user_id?: string;
|
||||
user_name?: string;
|
||||
message: string;
|
||||
status: 'pending' | 'resolved' | 'archived';
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export const reportsService = {
|
||||
async sendReport(message: string) {
|
||||
const response = await apiClient.post('/api/reports', { message });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getReports() {
|
||||
// This would be for the admin
|
||||
const response = await apiClient.get('/api/reports');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async updateReportStatus(reportId: string, status: string) {
|
||||
const response = await apiClient.patch(`/api/reports/${reportId}`, { status });
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user