fix: remove useless prop on feature button and add refactor reminder

This commit is contained in:
José Oliveira 2021-11-18 18:47:36 +00:00
parent d6ce5370fd
commit 77858b55bc
2 changed files with 5 additions and 2 deletions

View file

@ -14,6 +14,7 @@ const resolvers = {
},
Mutation: {
setCustomer: (root, { customerId, customerInput }, context, info) => {
// To be replaced by function that fetchs the token
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)
@ -22,11 +23,13 @@ const resolvers = {
saveCustomField: (...[, { customerId, fieldId, newValue }]) => customers.saveCustomField(customerId, fieldId, newValue),
removeCustomField: (...[, [ { customerId, fieldId } ]]) => customers.removeCustomField(customerId, fieldId),
editCustomer: async (root, { customerId, customerEdit }, context) => {
// To be replaced by function that fetchs the token
const token = !!context.req.cookies.lid && context.req.session.user.id
const editedData = await customerEdit
return customers.edit(customerId, editedData, token)
},
replacePhoto: async (root, { customerId, photoType, newPhoto }, context) => {
// To be replaced by function that fetchs the token
const token = !!context.req.cookies.lid && context.req.session.user.id
const photo = await newPhoto
if (!photo) return customers.getCustomerById(customerId)