Merge pull request #838 from chaotixkilla/feat-add-backend-support-customer-custom-fields

Add backend support to customer custom fields
This commit is contained in:
Rafael Taranto 2021-11-24 17:41:39 +00:00 committed by GitHub
commit abd3bcc625
5 changed files with 122 additions and 8 deletions

View file

@ -16,7 +16,10 @@ const resolvers = {
const token = !!context.req.cookies.lamassu_sid && context.req.session.user.id
if (customerId === anonymous.uuid) return customers.getCustomerById(customerId)
return customers.updateCustomer(customerId, customerInput, token)
}
},
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)
}
}