fix unit tests as well as missing code
API CI/CD / Validate (composer + pint) (push) Successful in 2m7s
API CI/CD / Test (PHPUnit) (push) Failing after 2m23s
API CI/CD / Build frontend assets (push) Successful in 2m18s
API CI/CD / Security audit (push) Successful in 31s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 2m7s
API CI/CD / Test (PHPUnit) (push) Failing after 2m23s
API CI/CD / Build frontend assets (push) Successful in 2m18s
API CI/CD / Security audit (push) Successful in 31s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Services\ClassProgress;
|
||||
use App\Models\ClassProgressAttachment;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ClassProgressAttachmentService
|
||||
{
|
||||
@@ -48,6 +49,11 @@ class ClassProgressAttachmentService
|
||||
$candidates = [];
|
||||
if (str_starts_with($path, 'storage/')) {
|
||||
$relative = ltrim(substr($path, strlen('storage/')), '/');
|
||||
$disk = (string) config('progress.attachments.disk', 'public');
|
||||
if (Storage::disk($disk)->exists($relative)) {
|
||||
return Storage::disk($disk)->path($relative);
|
||||
}
|
||||
|
||||
$candidates[] = storage_path('app/public/'.$relative);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ class ClassProgressMutationService
|
||||
'unit_title' => $unitTitle,
|
||||
'covered' => $covered,
|
||||
'homework' => $homework !== '' ? $homework : null,
|
||||
'next_week_plan' => trim((string) ($payload['next_week_plan'] ?? '')),
|
||||
'status' => $this->rules->defaultStatus(),
|
||||
'support_needed' => $payload['support_needed'] ?? null,
|
||||
'flags_json' => $this->rules->normalizeFlags($payload['flags'] ?? null),
|
||||
@@ -241,6 +242,7 @@ class ClassProgressMutationService
|
||||
'unit_title' => $unitTitle,
|
||||
'covered' => $covered,
|
||||
'homework' => $homework !== '' ? $homework : null,
|
||||
'next_week_plan' => trim((string) ($payload['next_week_plan'] ?? $existing?->next_week_plan ?? '')),
|
||||
];
|
||||
|
||||
if ($flagsPresent) {
|
||||
|
||||
Reference in New Issue
Block a user