Fixing bug where items were allowed to be deleted when referenced by a character

This commit is contained in:
2023-08-15 19:22:07 -05:00
parent abce265ba5
commit 5b9e100028
4 changed files with 85 additions and 5 deletions

View File

@ -21,9 +21,24 @@ var _ = Service("inventory", func() {
Field(1, "characterName", String)
})
Result(ArrayOf(String))
Error("NotFound")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
})
})
Method("listCharactersWithItem", func() {
Payload(func() {
Field(1, "itemName", String)
})
Result(ArrayOf(String))
Error("NotFound")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
})
})
@ -46,4 +61,17 @@ var _ = Service("inventory", func() {
Response("NotFound", CodeNotFound)
})
})
Method("removeAll", func() {
Payload(func() {
Field("1", "characterName", String)
})
Result(Empty)
Error("NotFound")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
})
})
})