Skip to content

Commit

Permalink
deleteByteCollectionCategory.ts updated
Browse files Browse the repository at this point in the history
  • Loading branch information
UsmanSaleem2003 committed Jul 2, 2024
1 parent 77367ff commit 48a390f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { prisma } from '@/prisma';
import { IncomingMessage } from 'http';

export default async function deleteByteCollection(_: any, args: QueryByteCollectionCategoryWithByteCollectionsArgs, context: IncomingMessage) {
const spaceById = await getSpaceById(args.spaceId);

checkEditSpacePermission(spaceById, context);

const byteCollectionCategory = await prisma.byteCollectionCategory.findUniqueOrThrow({
where: {
id: args.categoryId,
},
});

const spaceById = await getSpaceById(byteCollectionCategory.spaceId);

checkEditSpacePermission(spaceById, context);

await prisma.byteCollectionCategory.delete({
where: {
id: args.categoryId,
Expand Down

0 comments on commit 48a390f

Please sign in to comment.