save wysiwyg image size in url params instead of html tags (#10054)

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Malte Jürgens
2021-12-01 20:30:39 +01:00
committed by GitHub
parent 2be3ae715b
commit 1be8e1cd8d
3 changed files with 16 additions and 7 deletions

View File

@@ -1,9 +1,9 @@
export function addQueryToPath(path: string, query: Record<string, string>): string {
const queryParams = [];
const queryParams = new URLSearchParams(path.split('?')[1] || '');
for (const [key, value] of Object.entries(query)) {
queryParams.push(`${key}=${value}`);
queryParams.set(key, value);
}
return path.includes('?') ? `${path}&${queryParams.join('&')}` : `${path}?${queryParams.join('&')}`;
return path.split('?')[0] + '?' + queryParams;
}