π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
qp
Manav Rathi4c0c05a54a86
diff --git a/web/packages/base/origins.ts b/web/packages/base/origins.tsindex f904bebe4d..475e4f2e9f 100644--- a/web/packages/base/origins.ts+++ b/web/packages/base/origins.ts@@ -19,9 +19,23 @@ export const apiOrigin = async () =>* @param path The URL path usually, but can be anything that needs to be* suffixed to the origin. It must begin with a "/".*+ * @param queryParams An optional object containing query params. This is+ * appended to the generated URL after funneling it through+ * {@link URLSearchParams}.+ ** @returns path prefixed by {@link apiOrigin}.*/-export const apiURL = async (path: string) => (await apiOrigin()) + path;+export const apiURL = async (+ path: string,+ queryParams?: Record<string, string>,+) => {+ let url = (await apiOrigin()) + path;+ if (queryParams) {+ const params = new URLSearchParams(queryParams);+ url = `${url}?${params.toString()}`;+ }+ return url;+};/*** Return the overridden API origin, if one is defined by either (in prioritydiff --git a/web/packages/new/photos/services/user-entity/remote.ts b/web/packages/new/photos/services/user-entity/remote.tsindex 89297b25bb..2da4f01cb2 100644--- a/web/packages/new/photos/services/user-entity/remote.ts+++ b/web/packages/new/photos/services/user-entity/remote.ts@@ -194,10 +194,9 @@ export const putUserEntity = async (*/export const deleteUserEntity = async (id: string) =>ensureOk(- await fetch(await apiURL("/user-entity/entity"), {+ await fetch(await apiURL("/user-entity/entity", { id }), {method: "DELETE",headers: await authenticatedRequestHeaders(),- body: JSON.stringify({ id }),}),);