Преглед изворни кода

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

tags/0.0.1^2
toj пре 3 година
родитељ
комит
cd15778946

+ 0
- 1
backend/lib/models/grouping.js Прегледај датотеку

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

+ 0
- 1
backend/lib/models/matchqueue.js Прегледај датотеку

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

+ 0
- 1
backend/lib/models/membership.js Прегледај датотеку

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

+ 2
- 7
backend/lib/models/tag-association.js Прегледај датотеку

1
 const Schwifty = require('@hapipal/schwifty')
1
 const Schwifty = require('@hapipal/schwifty')
2
-const Joi = require('joi')
3
 
2
 
3
+const tagSchema = require('../schemas/tags')
4
 const Tag = require('./tag')
4
 const Tag = require('./tag')
5
 
5
 
6
 module.exports = class TagAssociation extends Schwifty.Model {
6
 module.exports = class TagAssociation extends Schwifty.Model {
20
         }
20
         }
21
     }
21
     }
22
     static get joiSchema() {
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 Прегледај датотеку

1
 const Schwifty = require('@hapipal/schwifty')
1
 const Schwifty = require('@hapipal/schwifty')
2
-const Joi = require('joi')
2
+const tagSchema = require('../schemas/tags')
3
 
3
 
4
 module.exports = class Tag extends Schwifty.Model {
4
 module.exports = class Tag extends Schwifty.Model {
5
     static get tableName() {
5
     static get tableName() {
6
         return 'tags'
6
         return 'tags'
7
     }
7
     }
8
     static get joiSchema() {
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 Прегледај датотеку

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

+ 0
- 1
backend/lib/routes/profile/match.js Прегледај датотеку

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

Loading…
Откажи
Сачувај