Ver código fonte

:fire: removing some unused vars | moving over some joi objects to schemas

tags/0.0.1^2
toj 3 anos atrás
pai
commit
cd15778946

+ 0
- 1
backend/lib/models/grouping.js Ver arquivo

@@ -1,6 +1,5 @@
1 1
 const Schwifty = require('@hapipal/schwifty')
2 2
 const groupingSchema = require('../schemas/groupings')
3
-const User = require('./user')
4 3
 const Profile = require('./profile')
5 4
 
6 5
 module.exports = class Grouping extends Schwifty.Model {

+ 0
- 1
backend/lib/models/matchqueue.js Ver arquivo

@@ -1,5 +1,4 @@
1 1
 const Schwifty = require('@hapipal/schwifty')
2
-const Joi = require('joi')
3 2
 const User = require('./user')
4 3
 const queueSchema = require('../schemas/queues')
5 4
 

+ 0
- 1
backend/lib/models/membership.js Ver arquivo

@@ -1,5 +1,4 @@
1 1
 const Schwifty = require('@hapipal/schwifty')
2
-const Joi = require('joi')
3 2
 const membershipSchema = require('../schemas/memberships')
4 3
 
5 4
 module.exports = class Membership extends Schwifty.Model {

+ 2
- 7
backend/lib/models/tag-association.js Ver arquivo

@@ -1,6 +1,6 @@
1 1
 const Schwifty = require('@hapipal/schwifty')
2
-const Joi = require('joi')
3 2
 
3
+const tagSchema = require('../schemas/tags')
4 4
 const Tag = require('./tag')
5 5
 
6 6
 module.exports = class TagAssociation extends Schwifty.Model {
@@ -20,11 +20,6 @@ module.exports = class TagAssociation extends Schwifty.Model {
20 20
         }
21 21
     }
22 22
     static get joiSchema() {
23
-        return Joi.object({
24
-            tag_association_id: Joi.number(),
25
-            profile_id: Joi.number(),
26
-            tag_id: Joi.number(),
27
-            is_deleted: Joi.bool(),
28
-        })
23
+        return tagSchema.association
29 24
     }
30 25
 }

+ 2
- 7
backend/lib/models/tag.js Ver arquivo

@@ -1,16 +1,11 @@
1 1
 const Schwifty = require('@hapipal/schwifty')
2
-const Joi = require('joi')
2
+const tagSchema = require('../schemas/tags')
3 3
 
4 4
 module.exports = class Tag extends Schwifty.Model {
5 5
     static get tableName() {
6 6
         return 'tags'
7 7
     }
8 8
     static get joiSchema() {
9
-        return Joi.object({
10
-            tag_id: Joi.number(),
11
-            tag_category: Joi.string(),
12
-            tag_description: Joi.string(),
13
-            is_active: Joi.bool(),
14
-        })
9
+        return tagSchema.single
15 10
     }
16 11
 }

+ 0
- 1
backend/lib/routes/profile/get.js Ver arquivo

@@ -1,6 +1,5 @@
1 1
 'use strict'
2 2
 
3
-const Joi = require('joi')
4 3
 const apiSchema = require('../../schemas/api')
5 4
 const errorSchema = require('../../schemas/errors')
6 5
 const profileSchema = require('../../schemas/profiles')

+ 0
- 1
backend/lib/routes/profile/match.js Ver arquivo

@@ -1,6 +1,5 @@
1 1
 'use strict'
2 2
 
3
-const Joi = require('joi')
4 3
 const apiSchema = require('../../schemas/api')
5 4
 const errorSchema = require('../../schemas/errors')
6 5
 const surveyResponseSchema = require('../../schemas/responses')

Carregando…
Cancelar
Salvar