Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

matchqueue.js 842B

1234567891011121314151617181920212223242526272829
  1. const Schwifty = require('@hapipal/schwifty')
  2. const Joi = require('joi')
  3. const User = require('./user')
  4. const queueSchema = require('../schemas/queues')
  5. module.exports = class MatchQueue extends Schwifty.Model {
  6. static get tableName() {
  7. return 'match_queues'
  8. }
  9. static get relationMappings() {
  10. return {
  11. user: {
  12. relation: Schwifty.Model.HasOneThroughRelation,
  13. modelClass: User,
  14. join: {
  15. from: 'match_queues.target_id',
  16. through: {
  17. from: 'profiles.profile_id',
  18. to: 'profiles.user_id',
  19. },
  20. to: 'users.user_id',
  21. },
  22. },
  23. }
  24. }
  25. static get joiSchema() {
  26. return queueSchema.single
  27. }
  28. }