fixes: cards alignment, error messages

This commit is contained in:
Mohamed Sohail 2024-01-31 18:33:23 +03:00
parent e0e63aaa19
commit 85ca52d5ab
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
4 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div <div
class="bg-white mx-2 p-4 rounded border border-gray-300 mb-4 md:min-w-[250px] md:w-full md:mx-0 lg:mx-4" class="lg:max-w-72 bg-white mx-1 p-4 rounded border border-gray-300 mb-4 md:min-w-[250px] md:w-full"
> >
<h2 class="text-l font-bold mb-2">{{ title }}</h2> <h2 class="text-l font-bold mb-2">{{ title }}</h2>
<p class="text-sm text-gray-600 mb-4">{{ subtitle }}</p> <p class="text-sm text-gray-600 mb-4">{{ subtitle }}</p>

View File

@ -152,7 +152,7 @@ const handleResponse = async (response, form$) => {
if (response.status <= 201) { if (response.status <= 201) {
formSubmitted.value = true; formSubmitted.value = true;
} else { } else {
form$.messageBag.append(response.data?.message); form$.messageBag.append(response.data?.error);
if (Object.keys(response.data.data)[0]?.message) { if (Object.keys(response.data.data)[0]?.message) {
form$.messageBag.append( form$.messageBag.append(
Object.keys(response.data.data)[0] + Object.keys(response.data.data)[0] +

View File

@ -21,4 +21,11 @@
link="/transaction" link="/transaction"
/> />
</div> </div>
<div class="mt-4 flex flex-col md:flex-row">
<Card
title="Redeem your points"
subtitle="For EverGrow organic fertilizer."
link="/redeem"
/>
</div>
</template> </template>

View File

@ -71,7 +71,7 @@
:conditions="[['tx', 'sell']]" :conditions="[['tx', 'sell']]"
/> />
<TextElement <TextElement
name="evergrow_quantity" name="evergrow_quantity_purchase"
label="How much EverGrow did you purchase?" label="How much EverGrow did you purchase?"
description="in 50kg bags of EverGrow. 1x50kg bag = 1, 2x50kg bags = 2, etc." description="in 50kg bags of EverGrow. 1x50kg bag = 1, 2x50kg bags = 2, etc."
rules="required|numeric|min:1|max:20" rules="required|numeric|min:1|max:20"
@ -79,7 +79,7 @@
:conditions="[['tx', 'buy']]" :conditions="[['tx', 'buy']]"
/> />
<TextElement <TextElement
name="evergrow_quantity" name="evergrow_quantity_sale"
label="How much EverGrow did you sell?" label="How much EverGrow did you sell?"
description="in 50kg bags of EverGrow. 1x50kg bag = 1, 2x50kg bags = 2, etc." description="in 50kg bags of EverGrow. 1x50kg bag = 1, 2x50kg bags = 2, etc."
rules="required|numeric|min:1|max:20" rules="required|numeric|min:1|max:20"
@ -116,7 +116,7 @@ const handleResponse = async (response, form$) => {
if (response.status <= 201) { if (response.status <= 201) {
formSubmitted.value = true; formSubmitted.value = true;
} else { } else {
form$.messageBag.append(response.data?.message); form$.messageBag.append(response.data?.error);
if (Object.keys(response.data.data)[0]?.message) { if (Object.keys(response.data.data)[0]?.message) {
form$.messageBag.append( form$.messageBag.append(
Object.keys(response.data.data)[0] + Object.keys(response.data.data)[0] +