Skip to content

Commit 3fb529e

Browse files
committed
feat(metadata): add param support to get all metadata
Get all metadata call does not need body. Instead, it requires query params to filter require data. Hence, I have removed the payload and replaced it with params
1 parent 80bc308 commit 3fb529e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

__test__/metadata.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ describe("Metadata", () => {
2828

2929
test("should retrieve all metadata", async () => {
3030
const metadata = new Metadata(connection);
31-
const metadataConfig = { some: "config" };
32-
await metadata.retrieveAllMetaData(metadataConfig);
31+
const metadataParams = { some: "config" };
32+
await metadata.retrieveAllMetaData(metadataParams);
3333
expect(connection.sendToParent).toHaveBeenCalledWith("stackQuery", {
3434
action: "getAllMetadata",
35-
payload: {
36-
...metadataConfig,
37-
},
35+
params: metadataParams,
3836
});
3937
});
4038

src/metadata.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@ class Metadata {
7070
return this._connection.sendToParent("stackQuery", data);
7171
}
7272

73-
retrieveAllMetaData(metadataConfig: AnyObject) {
73+
retrieveAllMetaData(params: AnyObject = {}) {
7474
const data = {
7575
action: metadataTypes.retrieveAllMetadata,
76-
payload: {
77-
...metadataConfig
78-
},
76+
params,
7977
};
8078

8179
return this._connection.sendToParent("stackQuery", data);

0 commit comments

Comments
 (0)