aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123@gmail.com>2020-06-12 16:14:56 +0300
committerilyayudovin <ilyayudovin123@gmail.com>2020-06-12 16:14:56 +0300
commitc9fc9c12b452d9aa8630cdfdaf494381a5dfdd8b (patch)
tree0c5abdfe7a779cfda25fd6aab876dcec0866716e
parent8fc9f8d09d64f3a1e5d0dac238eac6ac9629c45f (diff)
downloadwhich-api-c9fc9c12b452d9aa8630cdfdaf494381a5dfdd8b.tar.gz
feat: add profile.service
-rw-r--r--services/index.ts2
-rw-r--r--services/profile/profile.service.ts16
2 files changed, 18 insertions, 0 deletions
diff --git a/services/index.ts b/services/index.ts
index 441f9ad..9cd77c3 100644
--- a/services/index.ts
+++ b/services/index.ts
@@ -1,9 +1,11 @@
import { Application } from '@feathersjs/express';
import Users from './users/users.service';
import Polls from './polls/polls.service';
+import Profile from './profile/profile.service';
export default (app: Application): void => {
app.configure(Users);
app.configure(Polls);
+ app.configure(Profile);
};
diff --git a/services/profile/profile.service.ts b/services/profile/profile.service.ts
new file mode 100644
index 0000000..4a12def
--- /dev/null
+++ b/services/profile/profile.service.ts
@@ -0,0 +1,16 @@
+import {User} from '../../models/users/user.schema';
+import {Poll} from "../../models/polls/poll.schema";
+import {Application} from "@feathersjs/express";
+
+export class ProfileService {
+ user: User = Object;
+ saved_polls: Poll[] = [];
+
+ async find () {
+ return [this.user, this.saved_polls];
+ }
+}
+
+export default (app: Application): void => {
+ app.use('/profile', new ProfileService());
+}; \ No newline at end of file