-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed Aspect Ratio from Tidbit Collections * Removed VideoAspectRatio from TidbitsCollection * Removed VideoAspectRatio from TidbitsCollection * Removed VideoAspectRatio from TidbitsCollection * Delete ByteCollectionCategory functionality added * Deleted file : deleteByteCollectionCategory.ts * Added file : deleteByteCollectionCategory.ts * deleteByteCollectionCategory.ts updated * Removed VideoAspectRatio from ProjectByteCollection | Corrected deletion of Category by adding Archive * Corrected Prettier Issue * Fix prettier issue --------- Co-authored-by: robin <[email protected]>
- Loading branch information
1 parent
04cc2d4
commit fc27ead
Showing
9 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20240702152743_updated_deletion_schema/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `video_aspect_ratio` on the `project_byte_collections` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "byte_collections_category" ADD COLUMN "archive" BOOLEAN DEFAULT false; | ||
|
||
-- AlterTable | ||
ALTER TABLE "project_byte_collections" DROP COLUMN "video_aspect_ratio"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/graphql/mutations/byteCollectionCategory/deleteByteCollectionCategory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { QueryByteCollectionCategoryWithByteCollectionsArgs } from '@/graphql/generated/graphql'; | ||
import { getSpaceById } from '@/graphql/operations/space'; | ||
import { checkEditSpacePermission } from '@/helpers/space/checkEditSpacePermission'; | ||
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); | ||
|
||
try { | ||
const updatedbyteCollectionCategory = await prisma.byteCollectionCategory.update({ | ||
where: { | ||
id: args.categoryId, | ||
}, | ||
data: { | ||
archive: true, | ||
}, | ||
}); | ||
|
||
return updatedbyteCollectionCategory; | ||
} catch (e) { | ||
console.log(e); | ||
throw e; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters