Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 8b76cb3

Browse files
committed
fix: test fix and token creation fix from dashboard
1 parent a2c5c17 commit 8b76cb3

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/features/dashboard/hooks/useRegisterApp/__tests__/useRegisterApp.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ describe('Use Delete App', () => {
3434
expect(result.current.is_loading).toBeTruthy();
3535

3636
await expect(wsServer).toReceiveMessage({
37-
app_register: 1,
3837
name: 'app',
3938
redirect_uri: 'https://example.com',
4039
req_id: 1,

src/features/dashboard/register-app/__tests__/register-app.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ describe('Update App Dialog', () => {
239239

240240
await expect(wsServer).toReceiveMessage({
241241
app_markup_percentage: 0,
242-
app_register: 1,
243242
name: 'test app wrong name fake',
244243
redirect_uri: 'https://example.com',
245244
req_id: 1,
@@ -250,7 +249,6 @@ describe('Update App Dialog', () => {
250249
wsServer.send({
251250
echo_req: {
252251
app_markup_percentage: 0,
253-
app_register: 1,
254252
name: 'test app wrong name fake',
255253
redirect_uri: 'https://example.com',
256254
req_id: 1,

src/hooks/useWs/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ const useWS = <T extends TSocketEndpointNames>(name?: T) => {
2323
let payload = data;
2424

2525
if (name) {
26-
if (payload === undefined) payload = { [name]: 1, ...payload };
26+
if (payload === undefined) {
27+
payload = { [name]: 1, ...payload };
28+
} else if (name == 'api_token') {
29+
payload = { [name]: 1, ...payload };
30+
}
2731
} else {
2832
payload = { ...payload };
2933
}

0 commit comments

Comments
 (0)