From 499f2be5aee48d7679da8f5da6b2dd3c5b2b68bb Mon Sep 17 00:00:00 2001 From: Arthur Deierlein Date: Fri, 20 Sep 2024 16:10:29 +0200 Subject: [PATCH] refactor(frontend): use extends instead of EmberObject.extend --- frontend/app/adapters/activity-block.js | 12 ++++++------ frontend/app/serializers/attendance.js | 8 ++++---- frontend/app/serializers/employment.js | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/app/adapters/activity-block.js b/frontend/app/adapters/activity-block.js index ae5488ce2..84f076928 100644 --- a/frontend/app/adapters/activity-block.js +++ b/frontend/app/adapters/activity-block.js @@ -12,7 +12,7 @@ import ApplicationAdapter from "timed/adapters/application"; * @extends ApplicationAdapter * @public */ -export default ApplicationAdapter.extend({ +export default class ActivityBlockAdapter extends ApplicationAdapter { /** * Custom url for updating records * @@ -24,8 +24,8 @@ export default ApplicationAdapter.extend({ * @public */ urlForUpdateRecord(...args) { - return `${this._super(...args)}?include=activity`; - }, + return `${super.urlForUpdateRecord(...args)}?include=activity`; + } /** * Custom url for creating records @@ -38,6 +38,6 @@ export default ApplicationAdapter.extend({ * @public */ urlForCreateRecord(...args) { - return `${this._super(...args)}?include=activity`; - }, -}); + return `${super.urlForCreateRecord(...args)}?include=activity`; + } +} diff --git a/frontend/app/serializers/attendance.js b/frontend/app/serializers/attendance.js index d2ddaf624..1ec78c342 100644 --- a/frontend/app/serializers/attendance.js +++ b/frontend/app/serializers/attendance.js @@ -12,7 +12,7 @@ import ApplicationSerializer from "timed/serializers/application"; * @extends ApplicationSerializer * @public */ -export default ApplicationSerializer.extend({ +export default class AttendanceSerializer extends ApplicationSerializer { /** * The attribute mapping * @@ -24,8 +24,8 @@ export default ApplicationSerializer.extend({ * @property {String} to * @public */ - attrs: { + attrs = { from: "from-time", to: "to-time", - }, -}); + }; +} diff --git a/frontend/app/serializers/employment.js b/frontend/app/serializers/employment.js index de54c6c2b..4b6761adc 100644 --- a/frontend/app/serializers/employment.js +++ b/frontend/app/serializers/employment.js @@ -12,7 +12,7 @@ import ApplicationSerializer from "timed/serializers/application"; * @extends ApplicationSerializer * @public */ -export default ApplicationSerializer.extend({ +export default class EmploymentSerializer extends ApplicationSerializer { /** * The attribute mapping * @@ -24,8 +24,8 @@ export default ApplicationSerializer.extend({ * @property {String} end * @public */ - attrs: { + attrs = { start: "start-date", end: "end-date", - }, -}); + }; +}