feat: allow for cashbox batch editing

This commit is contained in:
Sérgio Salgado 2021-04-12 19:28:57 +01:00 committed by Josh Harvey
parent 21708aa75c
commit d6d8280a36
5 changed files with 119 additions and 18 deletions

View file

@ -3,6 +3,9 @@ const cashbox = require('../../../cashbox-batches')
const resolvers = {
Query: {
cashboxBatches: () => cashbox.getBatches()
},
Mutation: {
editBatch: (...[, { id, performedBy }]) => cashbox.editBatchById(id, performedBy)
}
}

View file

@ -14,6 +14,10 @@ const typeDef = gql`
type Query {
cashboxBatches: [CashboxBatch]
}
type Mutation {
editBatch(id: ID, performedBy: String): CashboxBatch
}
`
module.exports = typeDef