fix(mobile): resolve user avatars, chat alignment, timestamp formatting, and payslips API

This commit is contained in:
2026-08-10 17:55:14 +08:00
parent 6fe1fe125e
commit 9597cbf99a
1468 changed files with 172818 additions and 65664 deletions

View File

@@ -40,6 +40,7 @@ class TaskApiController extends Controller
'due_date' => $task->due_date ? $task->due_date->format('Y-m-d') : null,
'assignee_id' => $task->assignee_id,
'assignee_name' => $task->assignee ? $task->assignee->name : 'Unassigned',
'assignee_avatar' => $task->assignee && !empty($task->assignee->avatar) ? (check_file($task->assignee->avatar) ? get_file($task->assignee->avatar) : $task->assignee->avatar) : null,
'project_id' => $task->project_id,
'is_pinned' => $isPinned,
'subtasks_count' => $task->subtasks->count(),
@@ -314,4 +315,81 @@ class TaskApiController extends Controller
'errors' => null,
]);
}
public function toggleSubtaskDirect(Request $request, $id)
{
$subtask = MobileSubtask::find($id);
if (!$subtask) {
return response()->json([
'success' => false,
'data' => null,
'message' => 'Subtask not found',
'errors' => null,
], 404);
}
$subtask->update(['is_completed' => !$subtask->is_completed]);
return response()->json([
'success' => true,
'data' => $subtask,
'message' => 'Subtask toggled successfully',
'errors' => null,
]);
}
public function unassignedTasks(Request $request, $projectId)
{
$tasks = MobileTask::where('project_id', $projectId)
->whereNull('assignee_id')
->latest()
->get();
return response()->json([
'success' => true,
'data' => $tasks,
'message' => null,
'errors' => null,
]);
}
public function files(Request $request, $id)
{
return response()->json([
'success' => true,
'data' => [],
'message' => null,
'errors' => null,
]);
}
public function archive(Request $request, $id)
{
$task = MobileTask::find($id);
if ($task) {
$task->update(['status' => 'archived']);
}
return response()->json([
'success' => true,
'data' => $task,
'message' => 'Task archived successfully',
'errors' => null,
]);
}
public function destroySubtask(Request $request, $id)
{
$subtask = MobileSubtask::find($id);
if ($subtask) {
$subtask->delete();
}
return response()->json([
'success' => true,
'data' => null,
'message' => 'Subtask deleted successfully',
'errors' => null,
]);
}
}