fix: parsing payload when registering push notification subscriptions
This commit is contained in:
parent
65ce56cc08
commit
ffa53c61fa
1 changed files with 2 additions and 1 deletions
|
@ -26,10 +26,11 @@ function normalizeObjectArgs(q: Record<string, string>) {
|
|||
if (k.endsWith("]")) {
|
||||
const segments = k.split("[").map((p) => p.replace(/]$/g, ""));
|
||||
let d = dict;
|
||||
for (let i = 0; i < segments.length - 1; i++) {
|
||||
for (let i = 0; i < segments.length - 2; i++) {
|
||||
if (!(segments[i] in d)) d[segments[i]] = {};
|
||||
d = d[segments[i]];
|
||||
}
|
||||
d[segments[segments.length - 1]] = q[k];
|
||||
} else {
|
||||
dict[k] = q[k];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue