Multiple Issue Fixed

This commit is contained in:
Devansh 2022-05-09 16:53:16 +05:30
parent 0af35cae62
commit 0e5829cb6a
2 changed files with 9 additions and 5 deletions

View File

@ -25,16 +25,20 @@
<div class="control-group" :class="[errors.has('inventories[{{ $inventorySource->id }}]') ? 'has-error' : '']">
<label>{{ $inventorySource->name }}</label>
<input type="text" v-validate="'numeric|min:0'" name="inventories[{{ $inventorySource->id }}]" class="control" value="{{ $qty }}" data-vv-as="&quot;{{ $inventorySource->name }}&quot;"/>
<input
type="text"
name="inventories[{{ $inventorySource->id }}]"
class="control" value="{{ $qty }}"
onkeyup="document.getElementById('inventoryErrors{{ $product->id }}').innerHTML = ''" />
</div>
@endforeach
<div class="control-group has-error">
<span class="control-error" id="inventoryErrors"></span>
<span class="control-error" id="inventoryErrors{{ $product->id }}"></span>
</div>
<button class="btn btn-primary" onclick="saveEditQuantityForm('{{ route('admin.catalog.products.update-inventories', $product->id) }}', '{{ $product->id }}')">{{ __('admin::app.catalog.products.save') }}</button>
<button class="btn btn-danger" onclick="cancelEditQuantityForm('{{ $product->id }}')">{{ __('admin::app.catalog.products.cancel') }}</button>
</form>
</span>
</span>

View File

@ -76,7 +76,7 @@
.then(function (response) {
let data = response.data;
$('#inventoryErrors').text('');
$(`#inventoryErrors${productId}`).text('');
$(`#edit-product-${productId}-quantity-form-block`).hide();
@ -87,7 +87,7 @@
.catch(function ({ response }) {
let { data } = response;
$('#inventoryErrors').text(data.message);
$(`#inventoryErrors${productId}`).text(data.message);
});
}
</script>