summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-11-14 15:10:14 +0300
committereug-vs <eug-vs@keemail.me>2020-11-14 15:10:14 +0300
commitaacdb6343bb22fcbe6c601dfb62e8fb01a9acdb8 (patch)
tree1061cf028b508d90870dfc5a6d8a42d900e6bfd4
parentfd3efcdec584d550f70fb473386e01086e8238e0 (diff)
downloadbsu-fantom-aacdb6343bb22fcbe6c601dfb62e8fb01a9acdb8.tar.gz
feat: use class-based Events service
-rw-r--r--services/events/event.model.js6
-rw-r--r--services/events/event.schema.js16
-rw-r--r--services/events/event.service.js11
3 files changed, 6 insertions, 27 deletions
diff --git a/services/events/event.model.js b/services/events/event.model.js
deleted file mode 100644
index 7bac9d5..0000000
--- a/services/events/event.model.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const { model } = require('mongoose');
-const eventSchema = require('./event.schema.js');
-
-module.exports = model('Event', eventSchema);
-
-
diff --git a/services/events/event.schema.js b/services/events/event.schema.js
deleted file mode 100644
index 555153b..0000000
--- a/services/events/event.schema.js
+++ /dev/null
@@ -1,16 +0,0 @@
-const { Schema, Types } = require('mongoose');
-
-module.exports = new Schema({
- startDate: {
- type: Date,
- required: true
- },
- endDate: {
- type: Date,
- required: true
- },
- attendanceId: Number,
- conferenceId: Number,
- participantIds: [Types.ObjectId]
-}, { timestamps: true });
-
diff --git a/services/events/event.service.js b/services/events/event.service.js
index e9e7e50..e96ceda 100644
--- a/services/events/event.service.js
+++ b/services/events/event.service.js
@@ -1,7 +1,8 @@
-const service = require('feathers-mongoose');
-const Model = require('./event.model.js');
+class Events {
+ async create(data, params) {
+ return data;
+ };
+}
-const EventService = service({ Model })
-
-module.exports = app => app.use('/events', EventService);
+module.exports = app => app.use('/events', new Events());