Closed preetjdp closed 4 years ago
Describe the bug Currently it is possible to make a NewOwe Mutation on yourself, this needs to be solved.
To Reproduce Steps to reproduce the behavior: This sort of a mutation is allowed and that is a problem.
mutation { newOwe(data: { title: "Taxi Bill", amount: 100, issuedToID: "Ei66LhElIZ3eEQeqGBIp" }) { id issuedBy { id name } } }
Expected behavior To return an Error with state's something like 'You cannot make an Owe to yourSelf'
Screenshots
Additional context Code Snippet in question: https://github.com/preetjdp/YouOweMe/blob/b0b4ae728295c9ca1e9f68920cba069aed21f5d0/server/src/modules/Owe/NewOweResolver.ts#L19-L43
Fixed with commit https://github.com/preetjdp/YouOweMe/commit/c4b8fb0af6a51cf90d1e7472714075af665cf9f8
Although the error message does not seem that spectacular to me.
https://github.com/preetjdp/YouOweMe/blob/c4b8fb0af6a51cf90d1e7472714075af665cf9f8/server/src/modules/Owe/NewOweResolver.ts#L31-L33
Closing for now.
Describe the bug Currently it is possible to make a NewOwe Mutation on yourself, this needs to be solved.
To Reproduce Steps to reproduce the behavior: This sort of a mutation is allowed and that is a problem.
Expected behavior To return an Error with state's something like 'You cannot make an Owe to yourSelf'
Screenshots![image](https://user-images.githubusercontent.com/27439197/77822540-c1564900-7119-11ea-97cb-ca9086746de3.png)
Additional context Code Snippet in question: https://github.com/preetjdp/YouOweMe/blob/b0b4ae728295c9ca1e9f68920cba069aed21f5d0/server/src/modules/Owe/NewOweResolver.ts#L19-L43