|
|
@ -2,12 +2,9 @@ import { |
|
|
|
Controller, |
|
|
|
Controller, |
|
|
|
Get, |
|
|
|
Get, |
|
|
|
HttpCode, |
|
|
|
HttpCode, |
|
|
|
MaxFileSizeValidator, |
|
|
|
|
|
|
|
Param, |
|
|
|
Param, |
|
|
|
ParseFilePipe, |
|
|
|
|
|
|
|
Post, |
|
|
|
Post, |
|
|
|
Request, |
|
|
|
Request, |
|
|
|
UploadedFiles, |
|
|
|
|
|
|
|
UseInterceptors, |
|
|
|
UseInterceptors, |
|
|
|
} from '@nestjs/common'; |
|
|
|
} from '@nestjs/common'; |
|
|
|
import { AnyFilesInterceptor } from '@nestjs/platform-express'; |
|
|
|
import { AnyFilesInterceptor } from '@nestjs/platform-express'; |
|
|
@ -49,19 +46,25 @@ export class PublicDatasController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Post('/api/v1/db/public/shared-view/:sharedViewUuid/rows') |
|
|
|
@Post('/api/v1/db/public/shared-view/:sharedViewUuid/rows') |
|
|
|
@UseInterceptors(AnyFilesInterceptor()) |
|
|
|
@HttpCode(200) |
|
|
|
|
|
|
|
@UseInterceptors( |
|
|
|
|
|
|
|
AnyFilesInterceptor({ |
|
|
|
|
|
|
|
storage: multer.diskStorage({}), |
|
|
|
|
|
|
|
limits: { |
|
|
|
|
|
|
|
fieldSize: NC_ATTACHMENT_FIELD_SIZE, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
) |
|
|
|
async dataInsert( |
|
|
|
async dataInsert( |
|
|
|
@Request() req, |
|
|
|
@Request() req, |
|
|
|
@Param('sharedViewUuid') sharedViewUuid: string, |
|
|
|
@Param('sharedViewUuid') sharedViewUuid: string, |
|
|
|
@UploadedFiles() files: Express.Multer.File[], |
|
|
|
|
|
|
|
) { |
|
|
|
) { |
|
|
|
const insertResult = await this.publicDatasService.dataInsert({ |
|
|
|
const insertResult = await this.publicDatasService.dataInsert({ |
|
|
|
sharedViewUuid: sharedViewUuid, |
|
|
|
sharedViewUuid: sharedViewUuid, |
|
|
|
password: req.headers?.['xc-password'] as string, |
|
|
|
password: req.headers?.['xc-password'] as string, |
|
|
|
body: req.body?.data, |
|
|
|
body: req.body?.data, |
|
|
|
siteUrl: (req as any).ncSiteUrl, |
|
|
|
siteUrl: (req as any).ncSiteUrl, |
|
|
|
// enriched by multer
|
|
|
|
files: req.files, |
|
|
|
files, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return insertResult; |
|
|
|
return insertResult; |
|
|
|