fix: make accounts a object

This commit is contained in:
Taranto 2020-04-22 17:28:11 +01:00
parent ec73f0b022
commit 6b3db134e7
7 changed files with 26 additions and 38 deletions

View file

@ -196,7 +196,7 @@ const typeDefs = gql`
uptime: [ProcessStatus]
serverLogs: [ServerLog]
transactions: [Transaction]
accounts: [JSONObject]
accounts: JSONObject
config: JSONObject
}
@ -221,8 +221,7 @@ const typeDefs = gql`
setCustomer(customerId: ID!, customerInput: CustomerInput): Customer
saveConfig(config: JSONObject): JSONObject
createPairingTotem(name: String!): String
saveAccount(account: JSONObject): [JSONObject]
saveAccounts(accounts: [JSONObject]): [JSONObject]
saveAccounts(accounts: JSONObject): JSONObject
}
`
@ -259,7 +258,6 @@ const resolvers = {
machineSupportLogs: (...[, { deviceId }]) => supportLogs.insert(deviceId),
createPairingTotem: (...[, { name }]) => pairing.totem(name),
serverSupportLogs: () => serverLogs.insert(),
saveAccount: (...[, { account }]) => settingsLoader.saveAccounts([account]),
saveAccounts: (...[, { accounts }]) => settingsLoader.saveAccounts(accounts),
setCustomer: (...[, { customerId, customerInput } ]) => customers.updateCustomer(customerId, customerInput),
saveConfig: (...[, { config }]) => settingsLoader.saveConfig(config)