|
1 | | -import attr from 'ember-data/attr'; |
2 | | -import ModelBase from 'open-event-frontend/models/base'; |
3 | | -import { belongsTo, hasMany } from 'ember-data/relationships'; |
4 | | -import { computed } from '@ember/object'; |
5 | | -import { inject as service } from '@ember/service'; |
| 1 | +import attr from "ember-data/attr"; |
| 2 | +import ModelBase from "open-event-frontend/models/base"; |
| 3 | +import { belongsTo, hasMany } from "ember-data/relationships"; |
| 4 | +import { computed } from "@ember/object"; |
| 5 | +import { inject as service } from "@ember/service"; |
6 | 6 |
|
7 | 7 | export default class Group extends ModelBase.extend({ |
| 8 | + router: service(), |
| 9 | + fastboot: service(), |
8 | 10 |
|
9 | | - router : service(), |
10 | | - fastboot : service(), |
11 | | - |
12 | | - |
13 | | - name : attr('string'), |
14 | | - about : attr('string'), |
15 | | - logoUrl : attr('string'), |
16 | | - bannerUrl : attr('string'), |
17 | | - createdAt : attr('moment', { readOnly: true }), |
18 | | - modifiedAt : attr('moment'), |
19 | | - deletedAt : attr('moment'), |
20 | | - followerCount : attr('number'), |
21 | | - socialLinks : attr(), |
| 11 | + name: attr("string"), |
| 12 | + about: attr("string"), |
| 13 | + logoUrl: attr("string"), |
| 14 | + bannerUrl: attr("string"), |
| 15 | + createdAt: attr("moment", { readOnly: true }), |
| 16 | + modifiedAt: attr("moment"), |
| 17 | + deletedAt: attr("moment"), |
| 18 | + followerCount: attr("number"), |
| 19 | + socialLinks: attr(), |
22 | 20 | /** |
23 | 21 | * Relationships |
24 | 22 | */ |
25 | | - user : belongsTo('user'), |
26 | | - events : hasMany('event'), |
27 | | - roles : hasMany('users-groups-role'), |
28 | | - follower : belongsTo('user-follow-group', { inverse: 'group' }), |
29 | | - followers : hasMany('user-follow-group'), |
| 23 | + user: belongsTo("user"), |
| 24 | + events: hasMany("event"), |
| 25 | + roles: hasMany("users-groups-role"), |
| 26 | + follower: belongsTo("user-follow-group", { inverse: "group" }), |
| 27 | + followers: hasMany("user-follow-group"), |
30 | 28 |
|
31 | | - url: computed('identifier', function() { |
32 | | - const origin = this.fastboot.isFastBoot ? `${this.fastboot.request.protocol}//${this.fastboot.request.host}` : location.origin; |
33 | | - return origin + this.router.urlFor('groups.edit.events', this.id); |
34 | | - }) |
| 29 | + url: computed("identifier", function () { |
| 30 | + const origin = this.fastboot.isFastBoot |
| 31 | + ? `${this.fastboot.request.protocol}//${this.fastboot.request.host}` |
| 32 | + : location.origin; |
| 33 | + return origin + `/g/${this.id}`; |
| 34 | + }), |
35 | 35 | }) {} |
36 | | - |
0 commit comments