Skip to content

Commit

Permalink
fix dropdown file only source translation
Browse files Browse the repository at this point in the history
  • Loading branch information
adereksisusanto committed May 14, 2024
1 parent 157e766 commit d2308b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Http/Controllers/SourcePhraseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ public function edit(Phrase $phrase): Response|RedirectResponse
return redirect()->route('ltu.phrases.edit', $phrase->uuid);
}

$files = [];
foreach (collect($phrase->where('translation_id', $phrase->translation->id)->get())->unique('translation_file_id') as $value) {
$files[] = TranslationFile::where('id', $value->translation_file_id)->first();
}

return Inertia::render('source/edit', [
'phrase' => PhraseResource::make($phrase),
'translation' => TranslationResource::make($phrase->translation),
'source' => TranslationResource::make($phrase->translation),
'files' => TranslationFileResource::collection(TranslationFile::get()),
'files' => TranslationFileResource::collection($files),
'similarPhrases' => PhraseResource::collection($phrase->similarPhrases()),
]);
}
Expand Down

0 comments on commit d2308b0

Please sign in to comment.