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

Delete item #52

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Delete item #52

wants to merge 10 commits into from

Conversation

peelerzin
Copy link
Collaborator

Hey,

Here is my solution for the issue 44 to delete items from a list without removing the item itself.
After creating a patch request, it does indeed removed the item.

@peelerzin peelerzin requested review from dnmct and NoHara42 February 21, 2023 10:39
@peelerzin peelerzin self-assigned this Feb 21, 2023
@peelerzin peelerzin linked an issue Feb 21, 2023 that may be closed by this pull request
.env Outdated
@@ -0,0 +1,13 @@
# Environment variables declared in this file are automatically made available to Prisma.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't commit this file
git rm --cached name_of_file

tsconfig.json Outdated
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"module": "commonjs",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (err instanceof ZodError) {
response.status(400).send(`Wrong Data Sent =>${JSON.stringify(err)}`);
} else {
response.status(418).send("Something is wrong");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you're a teapot? 😄

@NoHara42 NoHara42 removed the request for review from dnmct February 21, 2023 13:40
ListID: null,
},
});
response.status(201).send("Removed Items");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

200 is more fitting here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks going to change it to 200.

id: id,
},
data: {
ListID: null,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use disconnect: true
instead of nulling the reference to the foreign key here.
https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#disconnect

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working, thanks.

Copy link
Collaborator

@NoHara42 NoHara42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverse merge before PR and see comments @peelerzin

@TheDoplarEffect
Copy link
Contributor

Removed .env file succesfully and tsconfig problem

@TheDoplarEffect TheDoplarEffect self-assigned this Feb 22, 2023
@TheDoplarEffect TheDoplarEffect marked this pull request as draft February 23, 2023 14:13
@ThoJah ThoJah self-assigned this Mar 3, 2023
@ThoJah ThoJah linked an issue Mar 3, 2023 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete item from list Updating addItem.ts, deleteItem.ts, seeLists.ts to the new prisma schema
4 participants