Skip to content

Commit

Permalink
[improve] eslint autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
VecHK committed Dec 19, 2023
1 parent bfba19d commit 0615a43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion server/app/controller/member/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = app => {
});
});

const [in_event_gallery] = galleries.filter(gallery => gallery.in_event);
const [ in_event_gallery ] = galleries.filter(gallery => gallery.in_event);
ctx.backData(200, {
active: in_event_gallery ? in_event_gallery : null,
galleries: galleries.filter(gallery => !gallery.in_event),
Expand Down
2 changes: 1 addition & 1 deletion server/app/controller/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = app => {
return Object.assign(gallery.toJSON(), { photos });
});

const [in_event_gallery] = galleries.filter(gallery => gallery.in_event);
const [ in_event_gallery ] = galleries.filter(gallery => gallery.in_event);
ctx.backData(200, {
active: in_event_gallery ? in_event_gallery : null,
galleries: galleries.filter(gallery => !gallery.in_event),
Expand Down
14 changes: 7 additions & 7 deletions server/app/model/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,27 @@ module.exports = app => {
// 在 event_start~submission_expire 这个时间范围内才显示为 true
type: VIRTUAL,
get() {
const now_date = new Date
const submission_expire_date = this.getDataValue('submission_expire')
const now_date = new Date();
const submission_expire_date = this.getDataValue('submission_expire');
return (
(now_date.valueOf() < submission_expire_date.valueOf()) &&
this.in_event
)
);
},
},

in_event: {
// 正在活动期间
type: VIRTUAL,
get() {
const now_date = new Date
const start_date = this.getDataValue('event_start')
const end_date = this.getDataValue('event_end')
const now_date = new Date();
const start_date = this.getDataValue('event_start');
const end_date = this.getDataValue('event_end');

return (
(now_date.valueOf() >= start_date.valueOf()) &&
(now_date.valueOf() <= end_date.valueOf())
)
);
},
},

Expand Down

0 comments on commit 0615a43

Please sign in to comment.