fix(dashboard,types): loyalty UI changes (#12764)

This commit is contained in:
Frane Polić
2025-06-18 20:38:36 +02:00
committed by GitHub
parent a7a264b13c
commit 52becfdb90
2 changed files with 2 additions and 42 deletions
@@ -40,8 +40,6 @@ const OrderBalanceSettlementSchema = zod.object({
credit_line: zod credit_line: zod
.object({ .object({
amount: zod.string().or(zod.number()).optional(), amount: zod.string().or(zod.number()).optional(),
reference: zod.string().optional(),
reference_id: zod.string().optional(),
note: zod.string().optional(), note: zod.string().optional(),
}) })
.optional(), .optional(),
@@ -84,8 +82,6 @@ export const OrderBalanceSettlementForm = ({
await createCreditLine( await createCreditLine(
{ {
amount: parseFloat(data.credit_line!.amount! as string) * -1, amount: parseFloat(data.credit_line!.amount! as string) * -1,
reference: data.credit_line!.reference ?? "order",
reference_id: data.credit_line!.reference_id ?? order.id,
}, },
{ {
onSuccess: () => { onSuccess: () => {
@@ -332,42 +328,6 @@ export const OrderBalanceSettlementForm = ({
) )
}} }}
/> />
<Form.Field
control={form.control}
name="credit_line.reference"
render={({ field }) => {
return (
<Form.Item>
<Form.Label>{t("fields.reference")}</Form.Label>
<Form.Control>
<Input {...field} />
</Form.Control>
<Form.ErrorMessage />
</Form.Item>
)
}}
/>
<Form.Field
control={form.control}
name="credit_line.reference_id"
render={({ field }) => {
return (
<Form.Item>
<Form.Label>{t("fields.reference_id")}</Form.Label>
<Form.Control>
<Input {...field} />
</Form.Control>
<Form.ErrorMessage />
</Form.Item>
)
}}
/>
</> </>
)} )}
</div> </div>
+2 -2
View File
@@ -2297,12 +2297,12 @@ export interface CreateOrderCreditLineDTO {
/** /**
* The reference model name that the credit line is generated from * The reference model name that the credit line is generated from
*/ */
reference: string | null reference?: string | null
/** /**
* The reference model id that the credit line is generated from * The reference model id that the credit line is generated from
*/ */
reference_id: string | null reference_id?: string | null
/** /**
* The metadata of the order detail * The metadata of the order detail