try with new submissions backend

This commit is contained in:
adueck 2024-11-27 23:03:26 +05:00
parent a307ddf84b
commit df685c3edb
1 changed files with 8 additions and 6 deletions

View File

@ -1,27 +1,29 @@
import * as FT from "../types/functions-types"; import * as FT from "../types/functions-types";
import * as AT from "../types/account-types"; import * as AT from "../types/account-types";
type Service = "account" | "functions"; type Service = "account" | "submissions"; // | "functions";
const baseUrl: Record<Service, string> = { const baseUrl: Record<Service, string> = {
account: "https://account.lingdocs.com/api/", 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 // FUNCTIONS CALLS - MUST BE RE-ROUTED THROUGH FIREBASE HOSTING IN ../../../firebase.json
export async function publishDictionary(): Promise< export async function publishDictionary(): Promise<
FT.PublishDictionaryResponse | FT.FunctionError FT.PublishDictionaryResponse | FT.FunctionError
> { > {
return (await myFetch("functions", "publishDictionary")) as throw new Error("not currently implemented on app");
| FT.PublishDictionaryResponse // return (await myFetch("functions", "publishDictionary")) as
| FT.FunctionError; // | FT.PublishDictionaryResponse
// | FT.FunctionError;
} }
export async function postSubmissions( export async function postSubmissions(
submissions: FT.SubmissionsRequest submissions: FT.SubmissionsRequest
): Promise<FT.SubmissionsResponse> { ): Promise<FT.SubmissionsResponse> {
return (await myFetch( return (await myFetch(
"functions", "submissions",
"submissions", "submissions",
"POST", "POST",
submissions submissions