fix: use gql upload lib and remove logs
This commit is contained in:
parent
3e4f4a4962
commit
68c635ce38
10 changed files with 112 additions and 70 deletions
|
|
@ -27,9 +27,10 @@ const resolvers = {
|
|||
return customers.edit(customerId, editedData, token)
|
||||
},
|
||||
replacePhoto: async (root, { customerId, photoType, newPhoto }, context) => {
|
||||
const token = !!context.req.cookies.lid && context.req.session.user.id
|
||||
const photo = await newPhoto
|
||||
return customers.replacePhoto(customerId, photoType, photo)
|
||||
.then(() => 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue