refactor: update assignment update logic to include recipientId and handle movements
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user