fix: apollo server image upload
This commit is contained in:
parent
9baa16c824
commit
3e4f4a4962
6 changed files with 103 additions and 10 deletions
|
|
@ -3,7 +3,6 @@ const customers = require('../../../customers')
|
|||
const filters = require('../../filters')
|
||||
|
||||
const resolvers = {
|
||||
// Upload: GraphQLUpload,
|
||||
|
||||
Customer: {
|
||||
isAnonymous: parent => (parent.customerId === anonymous.uuid)
|
||||
|
|
@ -22,9 +21,15 @@ 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),
|
||||
editCustomer: (root, { customerId, customerEdit }, context) => {
|
||||
editCustomer: async (root, { customerId, customerEdit }, context) => {
|
||||
const token = !!context.req.cookies.lid && context.req.session.user.id
|
||||
return customers.edit(customerId, customerEdit, token)
|
||||
const editedData = await customerEdit
|
||||
return customers.edit(customerId, editedData, token)
|
||||
},
|
||||
replacePhoto: async (root, { customerId, photoType, newPhoto }, context) => {
|
||||
const photo = await newPhoto
|
||||
return customers.replacePhoto(customerId, photoType, photo)
|
||||
.then(() => customers.getCustomerById(customerId))
|
||||
},
|
||||
deleteEditedData: (root, { customerId, customerEdit }) => {
|
||||
return customers.deleteEditedData(customerId, customerEdit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue