Skip to content

Commit 509f94c

Browse files
committed
Fix payment notifications API and clean up unused AddKindForm
- Fix payment notifications read-all endpoint by sending {} instead of undefined - Remove unused AddKindForm component and related props - Clean up KindsSection interfaces and component structure - Update layout components to remove onAddKind prop references
1 parent 8bf7318 commit 509f94c

File tree

6 files changed

+2
-57
lines changed

6 files changed

+2
-57
lines changed

src/api/paymentNotifications.api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const markNotificationAsRead = async (id: number): Promise<void> => {
7070

7171
// Mark all notifications as read for a user
7272
export const markAllNotificationsAsRead = async (pubkey?: string): Promise<void> => {
73-
await httpApi.post('/api/payment/notifications/read-all', pubkey ? { pubkey } : undefined);
73+
await httpApi.post('/api/payment/notifications/read-all', pubkey ? { pubkey } : {});
7474
};
7575

7676
// Get payment statistics

src/components/relay-settings/layouts/DesktopLayout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
9797
onKindsActiveChange,
9898
onKindsChange,
9999
onDynamicKindsChange,
100-
onAddKind,
101100
onRemoveKind,
102101
// Media props
103102
photos,
@@ -172,7 +171,6 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
172171
onKindsActiveChange={onKindsActiveChange}
173172
onKindsChange={onKindsChange}
174173
onDynamicKindsChange={onDynamicKindsChange}
175-
onAddKind={onAddKind}
176174
onRemoveKind={onRemoveKind}
177175
/>
178176

src/components/relay-settings/layouts/MobileLayout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export const MobileLayout: React.FC<MobileLayoutProps> = ({
9494
onKindsActiveChange,
9595
onKindsChange,
9696
onDynamicKindsChange,
97-
onAddKind,
9897
onRemoveKind,
9998
// Media props
10099
photos,
@@ -163,7 +162,6 @@ export const MobileLayout: React.FC<MobileLayoutProps> = ({
163162
onKindsActiveChange={onKindsActiveChange}
164163
onKindsChange={onKindsChange}
165164
onDynamicKindsChange={onDynamicKindsChange}
166-
onAddKind={onAddKind}
167165
onRemoveKind={onRemoveKind}
168166
/>
169167

src/components/relay-settings/sections/KindsSection/KindsSection.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { BaseSwitch } from '@app/components/common/BaseSwitch/BaseSwitch';
55
import * as S from '@app/pages/uiComponentsPages/UIComponentsPage.styles';
66
import { CollapsibleSection } from '../../shared/CollapsibleSection/CollapsibleSection';
77
import { KindsList } from './components/KindsList';
8-
import { AddKindForm } from './components/AddKindForm';
98
import { DynamicKindsList } from './components/DynamicKindsList';
109

1110
export interface KindsSectionProps {
@@ -17,7 +16,6 @@ export interface KindsSectionProps {
1716
onKindsActiveChange: (active: boolean) => void;
1817
onKindsChange: (values: string[]) => void;
1918
onDynamicKindsChange: (values: string[]) => void;
20-
onAddKind: (kind: string) => void;
2119
onRemoveKind: (kind: string) => void;
2220
}
2321

@@ -30,7 +28,6 @@ export const KindsSection: React.FC<KindsSectionProps> = ({
3028
onKindsActiveChange,
3129
onKindsChange,
3230
onDynamicKindsChange,
33-
onAddKind,
3431
onRemoveKind,
3532
}) => {
3633
const header = mode !== 'whitelist' ? 'Blacklisted Kind Numbers' : 'Kind Numbers';
@@ -57,11 +54,6 @@ export const KindsSection: React.FC<KindsSectionProps> = ({
5754
onKindsChange={onKindsChange}
5855
/>
5956

60-
<AddKindForm
61-
mode={mode}
62-
onAddKind={onAddKind}
63-
/>
64-
6557
<DynamicKindsList
6658
mode={mode}
6759
dynamicKinds={dynamicKinds}

src/components/relay-settings/sections/KindsSection/components/AddKindForm.tsx

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/hooks/usePaymentNotifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export const usePaymentNotifications = (initialParams?: PaymentNotificationParam
245245
'Content-Type': 'application/json',
246246
'Authorization': `Bearer ${token}`,
247247
},
248-
body: pubkey ? JSON.stringify({ pubkey }) : undefined,
248+
body: JSON.stringify(pubkey ? { pubkey } : {}),
249249
});
250250

251251
if (!response.ok) {

0 commit comments

Comments
 (0)