refactor: rename recipients route to people, update all frontend references
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { getI18n } from "@/i18n/server"
|
||||
import { AssetService } from "@/services/asset.service"
|
||||
import { ItemService } from "@/services/item.service"
|
||||
import { RecipientService } from "@/services/recipient.service"
|
||||
import { PersonService } from "@/services/person.service"
|
||||
import type { AssetWithAssignment } from "@/types"
|
||||
|
||||
import EditAssetForm from "../../_components/edit.asset.form"
|
||||
@@ -15,7 +15,7 @@ export default async function EditAssetPage({
|
||||
}) {
|
||||
const { assetId } = await params
|
||||
const items = await ItemService.findAll()
|
||||
const recipients = await RecipientService.findAll()
|
||||
const people = await PersonService.findAll()
|
||||
const asset = await AssetService.findById(assetId)
|
||||
const { dictionary } = await getI18n()
|
||||
const copy = dictionary.inventory.assets
|
||||
@@ -31,7 +31,7 @@ export default async function EditAssetPage({
|
||||
</div>
|
||||
<EditAssetForm
|
||||
items={items}
|
||||
recipients={recipients}
|
||||
recipients={people}
|
||||
asset={asset as unknown as AssetWithAssignment}
|
||||
formCopy={copy.form}
|
||||
schemaCopy={copy.schema}
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
import type {
|
||||
AssetWithAssignment,
|
||||
Item,
|
||||
Recipient,
|
||||
Person,
|
||||
UpdateAssetStatus,
|
||||
} from "@/types"
|
||||
|
||||
@@ -31,7 +31,7 @@ import type {
|
||||
interface EditAssetFormProps {
|
||||
asset: AssetWithAssignment
|
||||
items: Item[]
|
||||
recipients: Recipient[]
|
||||
recipients: Person[]
|
||||
formCopy: AssetFormCopy
|
||||
schemaCopy: AssetSchemaCopy
|
||||
statusCopy: AssetStatusCopy
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
buildCreateAssetSchema,
|
||||
type CreateAssetFormType,
|
||||
} from "@/schemas/asset.schema"
|
||||
import type { ItemWithoutStock, Recipient } from "@/types"
|
||||
import type { ItemWithoutStock, Person } from "@/types"
|
||||
|
||||
import type {
|
||||
AssetFormCopy,
|
||||
@@ -25,7 +25,7 @@ import type {
|
||||
|
||||
interface NewAssetFormProps {
|
||||
items: ItemWithoutStock[]
|
||||
recipients: Recipient[]
|
||||
recipients: Person[]
|
||||
formCopy: AssetFormCopy
|
||||
schemaCopy: AssetSchemaCopy
|
||||
statusCopy: AssetStatusCopy
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
import { getI18n } from "@/i18n/server"
|
||||
import { ItemService } from "@/services/item.service"
|
||||
import { RecipientService } from "@/services/recipient.service"
|
||||
import { PersonService } from "@/services/person.service"
|
||||
|
||||
import NewAssetForm from "../_components/new.asset.form"
|
||||
|
||||
export default async function NewAssetPage() {
|
||||
const items = await ItemService.findAllAssignable()
|
||||
const recipients = await RecipientService.findAll()
|
||||
const people = await PersonService.findAll()
|
||||
const { dictionary } = await getI18n()
|
||||
const copy = dictionary.inventory.assets
|
||||
|
||||
@@ -19,7 +19,7 @@ export default async function NewAssetPage() {
|
||||
</div>
|
||||
<NewAssetForm
|
||||
items={items}
|
||||
recipients={recipients}
|
||||
recipients={people}
|
||||
formCopy={copy.form}
|
||||
schemaCopy={copy.schema}
|
||||
statusCopy={copy.status}
|
||||
|
||||
Reference in New Issue
Block a user