-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.js
More file actions
36 lines (31 loc) · 810 Bytes
/
user.js
File metadata and controls
36 lines (31 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { LexModelBuildingService } = require('aws-sdk');
const { v4: uuidv4 } = require('uuid');
const dynamo = require('./dynamo')
const getUser = (uuid) => {
return dynamo.getDocument("user_profile", uuid);
}
const updateUser = (uuid, key, value) => {
return dynamo.updateDocument("user_profile", uuid, key, value);
}
const createUser = (uuid, name, birthdate, sex, email) => {
item = {
"uuid": uuid,
"name": name,
"birthdate": birthdate,
"sex": sex,
"email": email
}
return dynamo.createDocument("user_profile", item);
}
const deleteUser = (uuid) => {
primaryKey = {
"uuid": uuid
}
return dynamo.deleteDocument("user_profile", primaryKey);
}
module.exports = {
getUser,
updateUser,
createUser,
deleteUser,
}