feat: add edit, delete and image input

This commit is contained in:
José Oliveira 2021-10-27 23:54:50 +01:00
parent 421543f0c7
commit 3de7ae2fe9
12 changed files with 545 additions and 139 deletions

View file

@ -19,7 +19,14 @@ const resolvers = {
},
addCustomField: (...[, { customerId, label, value }]) => customers.addCustomField(customerId, label, value),
saveCustomField: (...[, { customerId, fieldId, newValue }]) => customers.saveCustomField(customerId, fieldId, newValue),
removeCustomField: (...[, [ { customerId, fieldId } ]]) => customers.removeCustomField(customerId, fieldId)
removeCustomField: (...[, [ { customerId, fieldId } ]]) => customers.removeCustomField(customerId, fieldId),
editCustomer: (root, { customerId, customerEdit }, context) => {
const token = !!context.req.cookies.lid && context.req.session.user.id
return customers.edit(customerId, customerEdit, token)
},
deleteEditedData: (root, { customerId, customerEdit }) => {
return customers.deleteEditedData(customerId, customerEdit)
}
}
}