feat: duplicate team and user collections (#4207)
* chore: created new mutation for team-collection duplication * feat: completed duplication function in TeamCollection module * feat: user-collection duplication complete * chore: changed duplicated title suffix for collections * chore: added return type to argument for duplication mutation in user-collections * chore: capitalized duplicate in duplicate collection service4 methods * chore: changed target of hopp-old-backend service to prod
This commit is contained in:
@@ -331,6 +331,26 @@ export class TeamCollectionResolver {
|
||||
return updatedTeamCollection.right;
|
||||
}
|
||||
|
||||
@Mutation(() => Boolean, {
|
||||
description: 'Duplicate a Team Collection',
|
||||
})
|
||||
@UseGuards(GqlAuthGuard, GqlCollectionTeamMemberGuard)
|
||||
@RequiresTeamRole(TeamMemberRole.OWNER, TeamMemberRole.EDITOR)
|
||||
async duplicateTeamCollection(
|
||||
@Args({
|
||||
name: 'collectionID',
|
||||
description: 'ID of the collection',
|
||||
})
|
||||
collectionID: string,
|
||||
) {
|
||||
const duplicatedTeamCollection =
|
||||
await this.teamCollectionService.duplicateTeamCollection(collectionID);
|
||||
|
||||
if (E.isLeft(duplicatedTeamCollection))
|
||||
throwErr(duplicatedTeamCollection.left);
|
||||
return duplicatedTeamCollection.right;
|
||||
}
|
||||
|
||||
// Subscriptions
|
||||
|
||||
@Subscription(() => TeamCollection, {
|
||||
|
||||
Reference in New Issue
Block a user