cli now uses DI
This commit is contained in:
parent
b680ede093
commit
9246da2e84
3 changed files with 46 additions and 13 deletions
|
|
@ -5,8 +5,21 @@ const invitesService = new InvitesServiceProvider({
|
|||
nostrService,
|
||||
}).provide();
|
||||
|
||||
module.exports = async function createAppInvite(inviterNpub) {
|
||||
const appInvite = await invitesService.createAppInvite(inviterNpub);
|
||||
console.log('Invite created');
|
||||
console.log(`Check at http://localhost/invite/${appInvite.uuid}`);
|
||||
};
|
||||
class CreateAppInviteProvider {
|
||||
constructor({ nostrService, invitesService }) {
|
||||
this.nostrService = nostrService;
|
||||
this.invitesService = invitesService;
|
||||
}
|
||||
|
||||
provide() {
|
||||
const createAppInvite = async (inviterNpub) => {
|
||||
const appInvite = await invitesService.createAppInvite(inviterNpub);
|
||||
console.log('Invite created');
|
||||
console.log(`Check at http://localhost/invite/${appInvite.uuid}`);
|
||||
};
|
||||
|
||||
return createAppInvite;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CreateAppInviteProvider;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue