refactor: update assignment update logic to include recipientId and handle movements

This commit is contained in:
2025-11-12 19:13:05 +01:00
parent 90de682cec
commit 3db1ddce23
2 changed files with 59 additions and 16 deletions
@@ -1,4 +1,5 @@
import { UpdateAssignmentFormType } from "@/lib/schemas/assignment.schemas"
import type { Item } from "@/lib/types"
import { AssetService } from "@/services/asset.service"
import { AssignmentService } from "@/services/assignment.service"
import { ItemService } from "@/services/item.service"
@@ -20,6 +21,13 @@ export default async function EditAssignmentPage({
return <div>Assignment not found</div>
}
let assignmentItem: Item = {} as Item
if (assignment.itemId) {
assignmentItem = (await ItemService.findById(assignment.itemId)) as Item
items.push(assignmentItem)
}
return (
<div>
<AssignmentForm