From f9da10093613ea4ecb202d6bfd7b9d6e694b0c5e Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Fri, 7 Feb 2025 22:41:39 -0300 Subject: [PATCH] refactor(swapNutzapsToWalletController): change to POST method --- src/app.ts | 2 +- src/controllers/api/ditto.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index dfb07240..8960e972 100644 --- a/src/app.ts +++ b/src/app.ts @@ -410,7 +410,7 @@ app.get('/api/v1/ditto/statuses/:id{[0-9a-f]{64}}/zapped_by', zappedByController app.post('/api/v1/ditto/wallet/create', requireSigner, createCashuWalletController); app.post('/api/v1/ditto/nutzap_information/create', requireSigner, createNutzapInformationController); -app.get('/api/v1/ditto/nutzap/swap_to_wallet', requireSigner, swapNutzapsToWalletController); +app.post('/api/v1/ditto/nutzap/swap_to_wallet', requireSigner, swapNutzapsToWalletController); app.post('/api/v1/reports', requireSigner, reportController); app.get('/api/v1/admin/reports', requireSigner, requireRole('admin'), adminReportsController); diff --git a/src/controllers/api/ditto.ts b/src/controllers/api/ditto.ts index 2ab3ceb6..c8098122 100644 --- a/src/controllers/api/ditto.ts +++ b/src/controllers/api/ditto.ts @@ -573,6 +573,7 @@ export const swapNutzapsToWalletController: AppController = async (c) => { } }); + // TODO: throw error if mintsToProofs is an empty object? for (const mint of Object.keys(mintsToProofs)) { const token = getEncodedToken({ mint, proofs: mintsToProofs[mint].proofs }, { version: 3 });