also set nym
This commit is contained in:
parent
6b52d06b3e
commit
90d8e39eb3
4 changed files with 82 additions and 3 deletions
|
|
@ -1,8 +1,9 @@
|
|||
const uuid = require('uuid');
|
||||
const ContactDetailsSet = require('../models/ContactDetailsSet');
|
||||
const NymSet = require('../models/NymSet');
|
||||
|
||||
async function setContactDetails(publicKey, encryptedContactDetails) {
|
||||
return ContactDetailsSet.create(
|
||||
return await ContactDetailsSet.create(
|
||||
{
|
||||
'uuid': uuid.v7(),
|
||||
public_key: publicKey,
|
||||
|
|
@ -12,6 +13,18 @@ async function setContactDetails(publicKey, encryptedContactDetails) {
|
|||
)
|
||||
}
|
||||
|
||||
async function setNym(publicKey, nym) {
|
||||
return await NymSet.create(
|
||||
{
|
||||
'uuid': uuid.v7(),
|
||||
public_key: publicKey,
|
||||
nym: nym,
|
||||
created_at: new Date().toISOString()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setContactDetails
|
||||
setContactDetails,
|
||||
setNym
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue