@ -68,7 +68,7 @@ issueRoutes.get<Record<string, string>, IssueResultsResponse>(
return next ( {
return next ( {
status : 403 ,
status : 403 ,
message :
message :
'You do not have permission to view issues crea ted by other users',
'You do not have permission to view issues repor ted by other users',
} ) ;
} ) ;
}
}
query = query . andWhere ( 'createdBy.id = :id' , { id : req.user?.id } ) ;
query = query . andWhere ( 'createdBy.id = :id' , { id : req.user?.id } ) ;
@ -291,7 +291,12 @@ issueRoutes.post<{ issueId: string; status: string }, Issue>(
}
}
) ;
) ;
issueRoutes . delete ( '/:issueId' , async ( req , res , next ) = > {
issueRoutes . delete (
'/:issueId' ,
isAuthenticated ( [ Permission . MANAGE_ISSUES , Permission . CREATE_ISSUES ] , {
type : 'or' ,
} ) ,
async ( req , res , next ) = > {
const issueRepository = getRepository ( Issue ) ;
const issueRepository = getRepository ( Issue ) ;
try {
try {
@ -320,6 +325,7 @@ issueRoutes.delete('/:issueId', async (req, res, next) => {
} ) ;
} ) ;
next ( { status : 404 , message : 'Issue not found.' } ) ;
next ( { status : 404 , message : 'Issue not found.' } ) ;
}
}
} ) ;
}
) ;
export default issueRoutes ;
export default issueRoutes ;