chore: remove semi

This commit is contained in:
Katie Thornhill 2019-11-19 23:06:33 -05:00
parent 4b75eaa0ab
commit 8fcc0dcbf9
No known key found for this signature in database
GPG key ID: F76EDC6541A99644
64 changed files with 1073 additions and 1073 deletions

View file

@ -1,40 +1,40 @@
const Service = require('./Service');
const Service = require('./Service')
class SessionsService extends Service {
constructor(ctx) {
super(ctx);
this.Session = ctx.M.Session;
super(ctx)
this.Session = ctx.M.Session
}
async get(id, { rolling }) {
const user = await this.Session.findOne({ where: { id } });
const user = await this.Session.findOne({ where: { id } })
if (user === null) {
return null;
return null
}
return user.data;
return user.data
}
async set(id, data, { maxAge, rolling, changed }) {
let session = await this.Session.findOne({ where: { id } });
let session = await this.Session.findOne({ where: { id } })
if (session === null) {
session = this.Session.build({ id });
session = this.Session.build({ id })
}
session.data = data;
session.maxAge = maxAge;
session.data = data
session.maxAge = maxAge
return session.save();
return session.save()
}
async destroy(id) {
const sess = await this.Session.findOne({ where: { id } });
const sess = await this.Session.findOne({ where: { id } })
if (sess != null) {
return sess.destroy();
return sess.destroy()
}
}
}
module.exports = SessionsService;
module.exports = SessionsService