Refactor CreateProductDialog and CreateStoreDialog components for improved form handling
- Remove unnecessary destructuring of form values in CreateProductDialog to simplify code. - Enhance conditional rendering in CreateStoreDialog to ensure proper checks for selected countries. - Update API request handling in CreateStoreDialog to enforce non-null assertions for required fields. - Adjust MerchantStore component to use underscore-prefixed parameters in event handlers for clarity. These changes streamline the form handling process and improve code readability across the components.
This commit is contained in:
parent
0c931cf457
commit
378e534a66
4 changed files with 11 additions and 12 deletions
|
|
@ -331,7 +331,6 @@ import {
|
|||
AlertCircle,
|
||||
User
|
||||
} from 'lucide-vue-next'
|
||||
import type { OrderStatus } from '@/modules/market/stores/market'
|
||||
import type { NostrmarketAPI, Merchant, Stall, Product } from '../services/nostrmarketAPI'
|
||||
import { auth } from '@/composables/useAuthService'
|
||||
import { useToast } from '@/core/composables/useToast'
|
||||
|
|
@ -542,12 +541,12 @@ const checkMerchantProfile = async () => {
|
|||
}
|
||||
|
||||
// Event handlers
|
||||
const onStoreCreated = async (stall: Stall) => {
|
||||
const onStoreCreated = async (_stall: Stall) => {
|
||||
await loadStallsList()
|
||||
toast.success('Store created successfully!')
|
||||
}
|
||||
|
||||
const onProductCreated = async (product: Product) => {
|
||||
const onProductCreated = async (_product: Product) => {
|
||||
await loadStallProducts()
|
||||
toast.success('Product created successfully!')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue