Skip to content

Commit

Permalink
refactor(frontend): use javascripts extends instead of Thing.extend (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras authored Dec 9, 2024
1 parent 37b60b8 commit fc9f919
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
12 changes: 6 additions & 6 deletions frontend/app/adapters/activity-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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
Expand All @@ -38,6 +38,6 @@ export default ApplicationAdapter.extend({
* @public
*/
urlForCreateRecord(...args) {
return `${this._super(...args)}?include=activity`;
},
});
return `${super.urlForCreateRecord(...args)}?include=activity`;
}
}
13 changes: 4 additions & 9 deletions frontend/app/serializers/attendance.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,15 @@ import ApplicationSerializer from "timed/serializers/application";
* @extends ApplicationSerializer
* @public
*/
export default ApplicationSerializer.extend({
export default class AttendanceSerializer extends ApplicationSerializer {
/**
* The attribute mapping
*
* This mapps some properties of the response to another
* property name of the model
*
* @property {Object} attrs
* @property {String} from
* @property {String} to
* @public
*/
attrs: {
attrs = {
from: "from-time",
to: "to-time",
},
});
};
}
13 changes: 4 additions & 9 deletions frontend/app/serializers/employment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,15 @@ import ApplicationSerializer from "timed/serializers/application";
* @extends ApplicationSerializer
* @public
*/
export default ApplicationSerializer.extend({
export default class EmploymentSerializer extends ApplicationSerializer {
/**
* The attribute mapping
*
* This mapps some properties of the response to another
* property name of the model
*
* @property {Object} attrs
* @property {String} start
* @property {String} end
* @public
*/
attrs: {
attrs = {
start: "start-date",
end: "end-date",
},
});
};
}

0 comments on commit fc9f919

Please sign in to comment.