Skip to content

Commit e6aaa56

Browse files
committed
fix: update downloadCommentByUserID to use insert_at for ordering and timezone adjustment
1 parent 82383f1 commit e6aaa56

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/Controllers/Api/DashboardController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function download(Stream $stream, CommentContract $comment): Stream
138138
]);
139139

140140
foreach ($comment->downloadCommentByUserID(Auth::id()) as $value) {
141-
$value->created_at = Time::factory($value->created_at)->tz(auth()->user()->getTimezone());
141+
$value->insert_at = Time::factory($value->insert_at)->tz(auth()->user()->getTimezone());
142142

143143
$data = array_map(function (mixed $value): mixed {
144144
if (is_bool($value)) {

app/Repositories/CommentRepositories.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ public function downloadCommentByUserID(int $id): Model
209209
'comments.gif_url',
210210
'comments.ip',
211211
'comments.user_agent',
212-
'comments.created_at',
212+
'comments.created_at as insert_at',
213213
'comments.parent_id'
214214
])
215-
->orderBy('comments.created_at', 'DESC')
215+
->orderBy('insert_at', 'DESC')
216216
->get();
217217
}
218218
}

0 commit comments

Comments
 (0)