Skip to content

Commit

Permalink
fix: change addAddress to post call
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnoW committed Oct 5, 2022
1 parent d082de9 commit ed6dfb2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-bottles-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moralisweb3/streams': patch
---

Fix put call to post call for Moralis.Streams.addAddress
2 changes: 1 addition & 1 deletion packages/integration/mockRequests/streamApi/addAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AddAddressResponse: Record<string, { data: any; status: number }> = {
},
};

export const mockAddAddressEvm = rest.put(`${STREAM_API_ROOT}/streams/evm/:id/address`, (req, res, ctx) => {
export const mockAddAddressEvm = rest.post(`${STREAM_API_ROOT}/streams/evm/:id/address`, (req, res, ctx) => {
const apiKey = req.headers.get('x-api-key');
const id = req.params.id as string;

Expand Down
2 changes: 1 addition & 1 deletion packages/streams/src/resolvers/evmStreams/addAddressEvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type BodyParams = operations[Name]['requestBody']['content']['application/json']
// Overwriting "address: string | string[]" because the generator cannot infer the type correctly from swagger
type ApiParams = Omit<PathParams & BodyParams, 'address'> & { address: string | string[] };
export type AddAddressEvmParams = ApiParams;
const method = 'put';
const method = 'post';
const bodyParams = ['address'] as const;

type ApiResult = operations[Name]['responses']['200']['content']['application/json'];
Expand Down

0 comments on commit ed6dfb2

Please sign in to comment.