feat: [bending] 기초자료 복사 버튼 추가 — 복사 후 수정 화면으로 이동
This commit is contained in:
@@ -203,6 +203,21 @@ public function update(Request $request, int $id)
|
||||
return redirect()->route('bending.base.show', $id)->with('success', '절곡품이 수정되었습니다.');
|
||||
}
|
||||
|
||||
public function duplicate(int $id)
|
||||
{
|
||||
$response = $this->api()->post("/api/v1/bending-items/{$id}/duplicate");
|
||||
|
||||
if (! $response->successful()) {
|
||||
return back()->withErrors(['api' => $response->json('message', '복사 실패')]);
|
||||
}
|
||||
|
||||
$newId = $response->json('data.id');
|
||||
$newCode = $response->json('data.code');
|
||||
|
||||
return redirect()->route('bending.base.edit', $newId)
|
||||
->with('success', "복사 완료 — 새 코드: {$newCode}");
|
||||
}
|
||||
|
||||
public function destroy(int $id)
|
||||
{
|
||||
$this->api()->delete("/api/v1/bending-items/{$id}");
|
||||
|
||||
Reference in New Issue
Block a user