Skip to content

Commit c9fc9c1

Browse files
committed
feat: add profile.service
1 parent 8fc9f8d commit c9fc9c1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

services/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { Application } from '@feathersjs/express';
22
import Users from './users/users.service';
33
import Polls from './polls/polls.service';
4+
import Profile from './profile/profile.service';
45

56
export default (app: Application): void => {
67
app.configure(Users);
78
app.configure(Polls);
9+
app.configure(Profile);
810
};
911

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {User} from '../../models/users/user.schema';
2+
import {Poll} from "../../models/polls/poll.schema";
3+
import {Application} from "@feathersjs/express";
4+
5+
export class ProfileService {
6+
user: User = Object;
7+
saved_polls: Poll[] = [];
8+
9+
async find () {
10+
return [this.user, this.saved_polls];
11+
}
12+
}
13+
14+
export default (app: Application): void => {
15+
app.use('/profile', new ProfileService());
16+
};

0 commit comments

Comments
 (0)