Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public function search(): JsonResource
$products = $this->productRepository
->pushCriteria(app(RequestCriteria::class))
->orderBy('created_at', 'desc')
->take(5)
->get();

return ProductResource::collection($products);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="flex flex-col gap-4">
{!! view_render_event('admin.leads.create.products.form_controls.table.before') !!}

<div class="block w-full overflow-x-auto">
<div class="block w-full">
<!-- Table -->
<x-admin::table>
{!! view_render_event('admin.leads.create.products.form_controls.table.head.before') !!}
Expand Down Expand Up @@ -92,10 +92,9 @@ class="flex max-w-max items-center gap-2 text-brandColor"
<x-admin::lookup
::src="src"
::name="`${inputName}[name]`"
::params="params"
:preload="true"
:placeholder="trans('admin::app.leads.common.products.product-name')"
@on-selected="(product) => addProduct(product)"
::value="{ id: product.product_id, name: product.name }"
/>

<x-admin::form.control-group.control
Expand Down Expand Up @@ -138,7 +137,7 @@ class="flex max-w-max items-center gap-2 text-brandColor"
:label="trans('admin::app.leads.common.products.price')"
:placeholder="trans('admin::app.leads.common.products.price')"
@on-change="(event) => product.price = event.value"
::value-label="$admin.formatPrice(product.price)"
::value-label="$admin.formatPrice(Number(product.price) || 0)"
position="center"
/>
</x-admin::form.control-group>
Expand All @@ -154,7 +153,7 @@ class="flex max-w-max items-center gap-2 text-brandColor"
rules="required|decimal:4"
:label="trans('admin::app.leads.common.products.total')"
:placeholder="trans('admin::app.leads.common.products.total')"
::value-label="$admin.formatPrice(product.price * product.quantity)"
::value-label="$admin.formatPrice((Number(product.price) || 0) * (Number(product.quantity) || 0))"
:allowEdit="false"
position="center"
/>
Expand Down Expand Up @@ -266,4 +265,4 @@ class="icon-delete cursor-pointer text-2xl"
}
});
</script>
@endPushOnce
@endPushOnce
Loading