update: update endDate

This commit is contained in:
손승우
2022-12-09 18:18:38 +09:00
parent d9b1d48e58
commit ef8aa2f9bc
2 changed files with 5 additions and 5 deletions

View File

@@ -18,11 +18,10 @@ export class ShareUrlController {
@UseGuards(JwtAuthGuard)
@Post('share-off/:dashboardId')
checkShareUrlOff(@Req() req, @Param() params, @Body() body) {
const { userId } = body;
checkShareUrlOff(@Req() req, @Param() params, @Body() shareUrlOnDto: ShareUrlOnDto) {
const { authorization } = req.headers;
const { dashboardId } = params;
return this.shareUrlService.checkShareUrlOff( authorization, dashboardId, userId )
return this.shareUrlService.checkShareUrlOff( authorization, dashboardId, shareUrlOnDto)
}
@Get('share-dashboard/:uuid')

View File

@@ -41,8 +41,8 @@ export class ShareUrlService {
}
}
async checkShareUrlOff( accessToken:string, dashboardId: number, userId: string ){
const findpass = await this.userRepository.findOne({ where: { userId: userId }})
async checkShareUrlOff( accessToken:string, dashboardId: number, shareUrlOnDto: ShareUrlOnDto){
const findpass = await this.userRepository.findOne({ where: { userId: shareUrlOnDto.userId }})
const findUser = await this.authService.checkAccess(accessToken, findpass.password);
if(!findUser){
return 'not exist user'
@@ -51,6 +51,7 @@ export class ShareUrlService {
const findDashboardShare = await this.dashboardShareRepository.findOne({ where: { id: findDashboard.shareId }})
findDashboardShare.shareToken = null;
findDashboardShare.shareYn = YesNo.NO;
findDashboardShare.endDate = null;
await this.dashboardShareRepository.save(findDashboardShare)
return { message: "success" }
}