-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bring back more current version of frontend
- Loading branch information
Showing
18 changed files
with
622 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict'; | ||
|
||
const Archetype = require('archetype'); | ||
const Log = require('../db/log'); | ||
const Player = require('../db/player'); | ||
const connect = require('../db/connect'); | ||
const extrovert = require('extrovert'); | ||
const { inspect } = require('util'); | ||
|
||
const ClearContextFactsParams = new Archetype({ | ||
sessionId: { | ||
$type: 'string', | ||
$required: true | ||
} | ||
}).compile('ClearContextFactsParams'); | ||
|
||
module.exports = extrovert.toNetlifyFunction(async params => { | ||
params = new ClearContextFactsParams(params); | ||
|
||
await connect(); | ||
|
||
await Log.info(`clearContextFacts ${inspect(params)}`, { | ||
...params, | ||
function: 'clearContextFacts' | ||
}); | ||
|
||
try { | ||
const { sessionId } = params; | ||
const player = await Player.findOne({ sessionId }).orFail(); | ||
|
||
player.contextFacts = []; | ||
|
||
await player.save(); | ||
return { ok: true }; | ||
} catch (err) { | ||
await Log.error(`clearContextFacts: ${err.message}`, { | ||
...params, | ||
function: 'clearContextFacts', | ||
message: err.message, | ||
stack: err.stack, | ||
err: inspect(err) | ||
}); | ||
|
||
throw err; | ||
} | ||
}, null, 'clearContextFacts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.