Skip to content

Commit

Permalink
chore: change typings, convert to Date
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca committed Oct 21, 2024
1 parent 6074cc6 commit f65e974
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'flarum/common/models/Discussion';
declare module 'flarum/common/models/Discussion' {
export default interface Discussion {
frontpage(): boolean;
frontdate(): string;
frontdate(): Date | null;
front(): boolean;
}
}
3 changes: 2 additions & 1 deletion js/src/forum/extend.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Extend from 'flarum/common/extenders';
import Discussion from 'flarum/common/models/Discussion';
import Model from 'flarum/common/Model';

export default [
new Extend.Model(Discussion) //
.attribute<boolean>('frontpage')
.attribute<string>('frontdate')
.attribute('frontdate', Model.transformDate)
.attribute<boolean>('front'),
];

0 comments on commit f65e974

Please sign in to comment.