Skip to content

Commit

Permalink
chore(frontend/models): adjust for ember-data v5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Sep 3, 2024
1 parent 2ead85a commit 76ec014
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions frontend/app/models/absence-balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export default class AbsenceBalance extends Model {
@attr("number") usedDays;
@attr("django-duration") usedDuration;
@attr("number") balance;
@belongsTo("user", { async: true, inverse: "absenceBalances" }) user;
@belongsTo("absence-type", { async: true, inverse: "absenceBalances" })
@belongsTo("user", { async: false, inverse: "absenceBalances" }) user;
@belongsTo("absence-type", { async: false, inverse: "absenceBalances" })
absenceType;
@hasMany("absence-credit", { async: true, inverse: null }) absenceCredits;
}
2 changes: 1 addition & 1 deletion frontend/app/models/absence-credit.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class AbsenceCredit extends Model {
* @property {AbsenceType} absenceType
* @public
*/
@belongsTo("absence-type", { async: true, inverse: null }) absenceType;
@belongsTo("absence-type", { async: false, inverse: null }) absenceType;

/**
* The user to which this credit belongs to
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/models/absence.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class Absence extends Model {
* @property {AbsenceType} absenceType
* @public
*/
@belongsTo("absence-type", { async: true, inverse: null }) absenceType;
@belongsTo("absence-type", { async: false, inverse: null }) absenceType;

/**
* The user
Expand Down
10 changes: 5 additions & 5 deletions frontend/app/models/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export default class Activity extends Model {
}

async start() {
const activity = this.store.createRecord("activity", {
const activity = await this.store.createRecord("activity", {
date: moment(),
fromTime: moment(),
task: this.task,
task: await this.task,
comment: this.comment,
review: this.review,
review: await this.review,
notBillable: this.notBillable,
});

Expand Down Expand Up @@ -97,9 +97,9 @@ export default class Activity extends Model {
if (moment().diff(this.date, "days") === 1) {
activities.push(
this.store.createRecord("activity", {
task: this.task,
task: await this.task,
comment: this.comment,
user: this.user,
user: await this.user,
date: moment(this.date).add(1, "days"),
review: this.review,
notBillable: this.notBillable,
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/models/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class Project extends Model {
* @property {BillingType} billingType
* @public
*/
@belongsTo("billing-type", { async: true, inverse: null }) billingType;
@belongsTo("billing-type", { async: false, inverse: null }) billingType;

/**
* The tasks
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/models/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ export default class Report extends Model {
* @property {Task} task
* @public
*/
@belongsTo("task", { async: true, inverse: null }) task;
@belongsTo("task", { async: false, inverse: null }) task;

/**
* The user
*
* @property {User} user
* @public
*/
@belongsTo("user", { async: true, inverse: null }) user;
@belongsTo("user", { async: false, inverse: null }) user;

/**
* The user which verified this report
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ export default class User extends Model {
* @property {User[]} supervisors
* @public
*/
@hasMany("user", { inverse: "supervisees", async: true }) supervisors;
@hasMany("user", { inverse: "supervisees", async: false }) supervisors;

/**
* The users supervisees
*
* @property {User[]} supervisees
* @public
*/
@hasMany("user", { inverse: "supervisors", async: true }) supervisees;
@hasMany("user", { inverse: "supervisors", async: false }) supervisees;

/**
* The users employments
Expand Down

0 comments on commit 76ec014

Please sign in to comment.