mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
Rename post.time
This commit is contained in:
parent
e1400b0ef9
commit
c2f6e2d7a3
|
@ -8,7 +8,7 @@ Object.assign(Post.prototype, {
|
|||
number: Model.attribute('number'),
|
||||
discussion: Model.hasOne('discussion'),
|
||||
|
||||
time: Model.attribute('time', Model.transformDate),
|
||||
createdAt: Model.attribute('createdAt', Model.transformDate),
|
||||
user: Model.hasOne('user'),
|
||||
contentType: Model.attribute('contentType'),
|
||||
content: Model.attribute('content'),
|
||||
|
|
|
@ -14,7 +14,7 @@ import fullTime from '../../common/helpers/fullTime';
|
|||
export default class PostMeta extends Component {
|
||||
view() {
|
||||
const post = this.props.post;
|
||||
const time = post.time();
|
||||
const time = post.createdAt();
|
||||
const permalink = this.getPermalink(post);
|
||||
const touch = 'ontouchstart' in document.documentElement;
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ class PostStream extends Component {
|
|||
const attrs = {'data-index': this.visibleStart + i};
|
||||
|
||||
if (post) {
|
||||
const time = post.time();
|
||||
const time = post.createdAt();
|
||||
const PostComponent = app.postComponents[post.contentType()];
|
||||
content = PostComponent ? PostComponent.component({post}) : '';
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class BasicPostSerializer extends AbstractSerializer
|
|||
$attributes = [
|
||||
'id' => (int) $post->id,
|
||||
'number' => (int) $post->number,
|
||||
'time' => $this->formatDate($post->created_at),
|
||||
'createdAt' => $this->formatDate($post->created_at),
|
||||
'contentType' => $post->type
|
||||
];
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ class PostReplyHandler
|
|||
$command->ipAddress
|
||||
);
|
||||
|
||||
if ($actor->isAdmin() && ($time = array_get($command->data, 'attributes.time'))) {
|
||||
if ($actor->isAdmin() && ($time = array_get($command->data, 'attributes.createdAt'))) {
|
||||
$post->created_at = new Carbon($time);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user