Skip to content

Commit

Permalink
try with new submissions backend
Browse files Browse the repository at this point in the history
  • Loading branch information
adueck committed Nov 27, 2024
1 parent a307ddf commit df685c3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions website/src/lib/backend-calls.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
import * as FT from "../types/functions-types";
import * as AT from "../types/account-types";

type Service = "account" | "functions";
type Service = "account" | "submissions"; // | "functions";

const baseUrl: Record<Service, string> = {
account: "https://account.lingdocs.com/api/",
functions: "https://functions.lingdocs.com/",
// clean up redundancy in call, put it all in api?
submissions: "https://account.lingdocs.com/",
};

// FUNCTIONS CALLS - MUST BE RE-ROUTED THROUGH FIREBASE HOSTING IN ../../../firebase.json
export async function publishDictionary(): Promise<
FT.PublishDictionaryResponse | FT.FunctionError
> {
return (await myFetch("functions", "publishDictionary")) as
| FT.PublishDictionaryResponse
| FT.FunctionError;
throw new Error("not currently implemented on app");
// return (await myFetch("functions", "publishDictionary")) as
// | FT.PublishDictionaryResponse
// | FT.FunctionError;
}

export async function postSubmissions(
submissions: FT.SubmissionsRequest
): Promise<FT.SubmissionsResponse> {
return (await myFetch(
"functions",
"submissions",
"submissions",
"POST",
submissions
Expand Down

0 comments on commit df685c3

Please sign in to comment.