Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to delete a prompt #2

Closed
arielweinberger opened this issue May 7, 2023 · 6 comments
Closed

Ability to delete a prompt #2

arielweinberger opened this issue May 7, 2023 · 6 comments
Assignees
Labels

Comments

@arielweinberger
Copy link
Member

arielweinberger commented May 7, 2023

We need to have the ability to delete a prompt.

add a service method to prompts.service.ts to delete the prompt. You'l use Prisma to delete it (look at the other methods in the service).

Then add a deletePrompt mutation to the prompts.resolver.ts.

The Delete button should be displayed as follows:
image

There's already a prompt deletion confirmation modal implemened (check out apps/console/src/app/pages/prompts/[promptId]/index.tsx line 69). So all in all it's a fun task.

p.s. you'll need to adjust the Prisma Schema to cascade delete all dependants of a Prompt when you delete it. You can see how to do that here.

@alceil
Copy link

alceil commented May 16, 2023

Can I work on this @arielweinberger ?

@ItayElgazar
Copy link
Contributor

@alceil Of course! Go for it.

@arielweinberger
Copy link
Member Author

Since there's no progress with this one, I'll leave it to somebody else from the community for now.

@arielweinberger
Copy link
Member Author

arielweinberger commented May 22, 2023

@AyanDas348 would you like to take this?

It's quite simply - add a service method to prompts.service.ts to delete the prompt. You'l use Prisma to delete it (look at the other methods in the service).

Then add a deletePrompt mutation to the prompts.resolver.ts.

The Delete button should be displayed as follows:
image

There's already a prompt deletion confirmation modal implemened (check out apps/console/src/app/pages/prompts/[promptId]/index.tsx line 69). So all in all it's a fun task.

p.s. you'll need to adjust the Prisma Schema to cascade delete all dependants of a Prompt when you delete it. You can see how to do that here.

@AyanDas348
Copy link
Contributor

@arielweinberger Sure I'll give it a try. Thanks!

@arielweinberger
Copy link
Member Author

Fixed in #84, to be released very soon in v0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants