feat: add request data to user_tokens and token filtering

This commit is contained in:
Sérgio Salgado 2020-10-26 09:57:31 +00:00 committed by Josh Harvey
parent c4e7547c45
commit 791b275cdf
9 changed files with 61 additions and 16 deletions

View file

@ -224,7 +224,7 @@ const typeDefs = gql`
transactionsCsv(from: Date, until: Date, limit: Int, offset: Int): String
accounts: JSONObject
config: JSONObject
userTokens: [UserToken]
userTokens(browser: String!, os: String!): [UserToken]
}
enum MachineAction {
@ -283,7 +283,7 @@ const resolvers = {
transactions.batch(from, until, limit, offset).then(parseAsync),
config: () => settingsLoader.loadLatestConfigOrNone(),
accounts: () => settingsLoader.loadAccounts(),
userTokens: () => tokenManager.getTokenList()
userTokens: (...[, { browser, os }]) => tokenManager.getTokenList(browser, os)
},
Mutation: {
machineAction: (...[, { deviceId, action, cassette1, cassette2, newName }]) => machineAction({ deviceId, action, cassette1, cassette2, newName }),