profile service

This commit is contained in:
counterweight 2025-03-06 01:28:47 +01:00
parent 56aa416751
commit a2939a7f2e
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 38 additions and 31 deletions

View file

@ -6,7 +6,8 @@ class ServicesProvider {
const nostrService = require('../services/nostrService');
const loginService = require('../services/loginService');
const sessionService = require('../services/sessionService');
const profileService = require('../services/profileService');
const ProfileServiceProvider = require('../services/profileService');
const profileService = new ProfileServiceProvider().provide();
const OfferServiceProvider = require('../services/offerService');
const offerService = new OfferServiceProvider().provide();

View file

@ -2,6 +2,8 @@ const uuid = require('uuid');
const models = require('../models');
class ProfileServiceProvider {
provide() {
async function setContactDetails(publicKey, encryptedContactDetails) {
return await models.ContactDetailsSet.create({
uuid: uuid.v7(),
@ -33,4 +35,8 @@ async function areProfileDetailsComplete(publicKey) {
return isNymSet && areContactDetailsSet;
}
module.exports = { setContactDetails, setNym, areProfileDetailsComplete };
return { setContactDetails, setNym, areProfileDetailsComplete };
}
}
module.exports = ProfileServiceProvider;