feat: a trash for tickets
Deleting a ticket now sends it to the trash, for whoever opened it or an admin: it disappears from boards, searches and statistics, cannot change, and comes back from the ticket page or the trash page for 30 days. After that it is deleted for good with the usual cascade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -290,6 +290,36 @@ export class IssueResolver {
|
||||
);
|
||||
}
|
||||
|
||||
@Mutation(() => CommandResultGql, {
|
||||
description:
|
||||
'To the trash (whoever opened it, or an owner/admin): hidden everywhere, deleted for good after 30 days',
|
||||
})
|
||||
trashIssue(
|
||||
@CurrentUser() me: User,
|
||||
@Args('issueId', { type: () => ID }) issueId: string,
|
||||
) {
|
||||
return this.issuesService.trash(me.id, issueId);
|
||||
}
|
||||
|
||||
@Mutation(() => CommandResultGql, { description: 'Back from the trash' })
|
||||
restoreIssue(
|
||||
@CurrentUser() me: User,
|
||||
@Args('issueId', { type: () => ID }) issueId: string,
|
||||
) {
|
||||
return this.issuesService.restore(me.id, issueId);
|
||||
}
|
||||
|
||||
@OptionalAuth()
|
||||
@Query(() => [IssueGql], {
|
||||
description: "A project's tickets in the trash, newest first",
|
||||
})
|
||||
trash(
|
||||
@CurrentUser() me: User | undefined,
|
||||
@Args('projectId', { type: () => ID }) projectId: string,
|
||||
) {
|
||||
return this.issuesService.trashed(viewerOf(me), projectId);
|
||||
}
|
||||
|
||||
@Mutation(() => BulkResultGql, {
|
||||
description:
|
||||
'The same change on up to 100 tickets; each goes through the normal rules and may refuse on its own',
|
||||
|
||||
Reference in New Issue
Block a user