|
@@ -9,7 +9,7 @@
|
|
|
* the Angular history tab and do not conflict with the Hoarding architecture.
|
|
* the Angular history tab and do not conflict with the Hoarding architecture.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-import { Controller, Get, Res, Param } from '@nestjs/common';
|
|
|
|
|
|
|
+import { Controller, Get, Delete, Res, Param } from '@nestjs/common';
|
|
|
import { PalmOilService } from './palm-oil.service';
|
|
import { PalmOilService } from './palm-oil.service';
|
|
|
import { Response } from 'express';
|
|
import { Response } from 'express';
|
|
|
import * as fs from 'fs';
|
|
import * as fs from 'fs';
|
|
@@ -23,6 +23,16 @@ export class PalmOilController {
|
|
|
return this.palmOilService.getHistory();
|
|
return this.palmOilService.getHistory();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Delete('history/:archiveId')
|
|
|
|
|
+ async deleteRecord(@Param('archiveId') archiveId: string) {
|
|
|
|
|
+ return this.palmOilService.deleteRecord(archiveId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Delete('history')
|
|
|
|
|
+ async clearAllHistory() {
|
|
|
|
|
+ return this.palmOilService.clearAllHistory();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Get('archive/:id')
|
|
@Get('archive/:id')
|
|
|
async getArchivedImage(@Param('id') id: string, @Res() res: Response) {
|
|
async getArchivedImage(@Param('id') id: string, @Res() res: Response) {
|
|
|
const record = await this.palmOilService.getRecordByArchiveId(id);
|
|
const record = await this.palmOilService.getRecordByArchiveId(id);
|