Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
doLogin () {
console.log(this.state)
publicClient.query(q.Login(q.Match(q.Index("users_by_login"), this.state.login), {
password : this.state.password
})).then((key) => {
saveTokens(key.secret);
this.authorized(false);
})
}
["doSign Up"] () {
queryItemsForSale() {
return this.client.query(
q.Map(
q.Paginate(q.Match(q.Index("items_for_sale"), true)),
(row) =>
q.Let({doc : q.Get(row)}, {
ref : q.Select(["ref"], q.Var("doc")),
data : {
label : q.Select(["data","label"], q.Var("doc")),
price : q.Select(["data","price"], q.Var("doc")),
owner : q.Select(["data","owner"], q.Var("doc")),
owner_name :
q.Select(["data","name"],
q.Get(q.Select(["data","owner"], q.Var("doc"))))
}
})
)
);
}
listPlayers() {
return this.client.query(
q.Map(
q.Paginate(q.Match(q.Index("players"))),
(row) => q.Get(row)
)
);
}
})).then(() => publicClient.query(
q.Login(q.Match(q.Index("users_by_login"), this.state.login), {
password : this.state.password
}))).then((key) => {
saveTokens(key.secret);
listPurchases() {
return this.client.query(
q.Map(
q.Paginate(q.Match(q.Index("purchases")), {before : null}),
(row) => q.Let({row:q.Get(row)},
q.Let({
buyer : q.Get(q.Select(["data","buyer"], q.Var("row"))),
seller : q.Get(q.Select(["data","seller"], q.Var("row"))),
price : q.Select(["data","price"], q.Var("row")),
item : q.Get(q.Select(["data","item"], q.Var("row")))
},
{
buyer : q.Select(["data","name"], q.Var("buyer")),
seller : q.Select(["data","name"], q.Var("seller")),
price : q.Var("price"),
label : q.Select(["data","label"], q.Var("item")),
key : q.Select(["ref"], q.Var("row"))
}
))
)