Created
April 25, 2020 08:47
-
-
Save digitalbase/9a81aa3a2aa61a0d2b8fb73aa3d8fc09 to your computer and use it in GitHub Desktop.
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
// /src/handlers/api/getAnonymous.js | |
const { withStatusCode } = require('../../utils/response.util'); | |
const dynamoDBFactory = require('../../dynamodb.factory'); | |
const ok = withStatusCode(200, JSON.stringify); | |
const { SourceAttributionModel } = require('../../models/SourceAttribution'); | |
const dynamoDb = dynamoDBFactory(); | |
const model_source = new SourceAttributionModel(dynamoDb); | |
exports.handler = async (event) => { | |
const { id } = event.pathParameters; | |
const attributionSessions = await model_source.getForAnonymousId(id); | |
return ok({ | |
sessions: attributionSessions | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment