Skip to content
Merged
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 @@ -153,7 +153,7 @@ export function ProductPersonalizationManager() {
<ComponentAccordionItem
key={component.id}
component={component}
selectedProduct={m.selectedProduct}
selectedProduct={m.selectedProduct ?? ''}
locations={m.getLocationsForComponent(component.id)}
techniques={m.techniques}
locationTechniques={m.locationTechniques || []}
Expand Down
4 changes: 2 additions & 2 deletions src/components/admin/suppliers-manager/useSuppliersManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ export function useSuppliersManager() {
null;

const payload: Record<string, unknown> = {
name: es.name.trim(),
name: (es.name ?? '').trim(),
code:
es.code?.trim() ||
es.name
(es.name ?? '')
.trim()
.toUpperCase()
.replace(/\s+/g, '_')
Expand Down
2 changes: 1 addition & 1 deletion src/components/magic-up/AdImageResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export function AdImageResult({
<CardContent className="p-0">
<div className="group relative">
<img
src={imageUrl}
src={imageUrl ?? undefined}
alt={productName ? `Imagem publicitária - ${productName}` : 'Imagem publicitária'}
className="aspect-square w-full object-cover"
loading="lazy"
Expand Down
2 changes: 1 addition & 1 deletion src/components/pricing/simulator/MultiEngravingResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export function MultiEngravingResult({
<Badge
variant="outline"
className="cursor-pointer font-mono text-xs transition-colors hover:bg-muted"
onClick={() => handleCopyCode(calc.priceData.codigo_orcamento)}
onClick={() => handleCopyCode(calc.priceData?.codigo_orcamento ?? '')}
>
{copied === calc.priceData.codigo_orcamento ? (
<CheckCircle2 className="mr-1 h-3 w-3 text-primary dark:text-primary" />
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/common/useOrgData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function useOrgCreate(tableName: string) {
.insert({
...payload,
organization_id: currentOrg.id,
})
} as never)
.select()
.single();

Expand Down Expand Up @@ -95,7 +95,7 @@ export function useOrgUpdate(tableName: string) {
mutationFn: async ({ id, ...payload }: { id: string; [key: string]: unknown }) => {
const { data, error } = await supabase
.from(tableName as never)
.update(payload)
.update(payload as never)
.eq('id', id)
.select()
.single();
Expand Down
Loading