Skip to content

Commit b2be3a1

Browse files
committed
Update to filePath
1 parent db77bf8 commit b2be3a1

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

backend/src/reports/models/report.model.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,23 @@ export class Report {
1616
title: string;
1717

1818
@ApiProperty({ description: 'Whether the report is bookmarked' })
19-
bookmark: boolean;
19+
bookmarked: boolean;
2020

2121
@ApiProperty({ description: 'Category of the report' })
2222
category: string;
2323

2424
@ApiProperty({ description: 'Date of the report' })
2525
date: string;
2626

27-
@ApiProperty({ description: 'Doctor associated with the report' })
28-
doctor: string;
29-
30-
@ApiProperty({ description: 'Facility where the report was created' })
31-
facility: string;
32-
3327
@ApiProperty({
3428
description: 'Status of the report',
3529
enum: ReportStatus,
3630
default: ReportStatus.UNREAD,
3731
})
3832
status: ReportStatus;
3933

40-
@ApiProperty({ description: 'File URL of the report' })
41-
fileUrl: string;
34+
@ApiProperty({ description: 'File path of the report' })
35+
filePath: string;
4236

4337
@ApiProperty({ description: 'Creation timestamp' })
4438
createdAt: string;

backend/src/reports/reports.controller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,22 @@ export class ReportsController {
117117
schema: {
118118
type: 'object',
119119
properties: {
120-
fileUrl: {
120+
filePath: {
121121
type: 'string',
122-
description: 'S3 file URL for the report',
122+
description: 'S3 file path for the report',
123123
},
124124
},
125-
required: ['fileUrl'],
125+
required: ['filePath'],
126126
},
127-
description: 'S3 file URL for the report',
127+
description: 'S3 file path for the report',
128128
})
129129
@Post()
130130
async createReport(
131-
@Body('fileUrl') fileUrl: string,
131+
@Body('filePath') filePath: string,
132132
@Req() request: RequestWithUser,
133133
): Promise<Report> {
134134
const userId = this.extractUserId(request);
135-
return this.reportsService.saveReport(fileUrl, userId);
135+
return this.reportsService.saveReport(filePath, userId);
136136
}
137137

138138
private extractUserId(request: RequestWithUser): string {

backend/src/reports/reports.service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ export class ReportsService {
253253
}
254254
}
255255

256-
async saveReport(fileUrl: string, userId: string): Promise<Report> {
257-
if (!fileUrl) {
256+
async saveReport(filePath: string, userId: string): Promise<Report> {
257+
if (!filePath) {
258258
throw new NotFoundException('File URL is required');
259259
}
260260

@@ -266,13 +266,11 @@ export class ReportsService {
266266
const newReport: Report = {
267267
id: uuidv4(),
268268
userId,
269-
fileUrl,
269+
filePath,
270270
title: 'New Report',
271-
bookmark: false,
271+
bookmarked: false,
272272
category: '',
273273
date: '',
274-
doctor: '',
275-
facility: '',
276274
status: ReportStatus.UNREAD,
277275
createdAt: new Date().toISOString(),
278276
updatedAt: new Date().toISOString(),

0 commit comments

Comments
 (0)