Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 4def18e

Browse files
committed
fix(desktop): query parameters not working
1 parent 03024ef commit 4def18e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/server/src/routes/electron.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Application } from "express";
33
import type { ParamsDictionary, Request, Response } from "express-serve-static-core";
44
import type QueryString from "qs";
55
import { Session, SessionData } from "express-session";
6+
import { parse as parseQuery } from "qs";
67
import EventEmitter from "events";
78

89
type MockedResponse = Response<any, Record<string, any>, number>;
@@ -55,7 +56,7 @@ class FakeRequest extends EventEmitter implements Pick<Request<ParamsDictionary,
5556
body: any;
5657
headers: Record<string, string>;
5758
session: Session & Partial<SessionData>;
58-
query: Record<string, any> = {};
59+
query: Record<string, any>;
5960

6061
constructor(arg: Arg) {
6162
super();
@@ -64,6 +65,7 @@ class FakeRequest extends EventEmitter implements Pick<Request<ParamsDictionary,
6465
this.body = arg.data;
6566
this.headers = arg.headers;
6667
this.session = fakeSession;
68+
this.query = parseQuery(arg.url.split("?")[1] || "", { ignoreQueryPrefix: true });
6769
}
6870
}
6971

0 commit comments

Comments
 (0)