mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-22 11:05:09 -05:00
when updating build if build top false set it to null
This commit is contained in:
@@ -271,7 +271,10 @@ const resolvers = {
|
||||
if (ctx.user.discord_id !== build.discord_id)
|
||||
throw new AuthenticationError("no privileges to edit the build")
|
||||
|
||||
await Build.findByIdAndUpdate(build._id, { ...args }).catch(e => {
|
||||
await Build.findByIdAndUpdate(build._id, {
|
||||
...args,
|
||||
top: build.top ? build.top : null,
|
||||
}).catch(e => {
|
||||
throw new UserInputError(error.message, {
|
||||
invalidArgs: args,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user