fix: latest customer data selection and button margin

This commit is contained in:
José Oliveira 2021-11-10 19:02:46 +00:00
parent 68c635ce38
commit b77b732bcb
5 changed files with 58 additions and 34 deletions

View file

@ -29,11 +29,13 @@ const resolvers = {
replacePhoto: async (root, { customerId, photoType, newPhoto }, context) => {
const token = !!context.req.cookies.lid && context.req.session.user.id
const photo = await newPhoto
if (!photo) return customers.getCustomerById(customerId)
return customers.updateEditedPhoto(customerId, photo, photoType)
.then(newPatch => customers.edit(customerId, newPatch, token))
},
deleteEditedData: (root, { customerId, customerEdit }) => {
return customers.deleteEditedData(customerId, customerEdit)
// NOT IMPLEMENTING THIS FEATURE FOR THE CURRENT VERSION
return customers.getCustomerById(customerId)
}
}
}