Skip to content

Conversation

@BenraouaneSoufiane
Copy link

No description provided.

};
try {
const response = await fetch(url + fileId, {
const response = await fetch(BuildURI.from(url).appendRelative('drive/v3/files') + fileId, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appendRelative('x').appendRelative('y')

headers = {
Authorization: `Bearer ${auth}`,
};
response = await fetch(url.appendRelative(`drive/v3/files/${fileId}`).setParam("alt", "media").toString(), {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better but you can chain .appendRelative

fileData: Blob,
auth: string,
store: "data" | "wal" | "meta"
store: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave it strongly typed.
there might needed a small helper like:
function toStore(s: string): "data" | "wal" | "meta" {
if (["data", "wal", "meta"].include(s)) { return s as "data"|"wal"|"meta" }
throw new Error(unknown Store:${s})
}

}
}
async #search(fileName: string, auth: string): Promise<Result<string>> {
async #search(fileName: string, auth: string, store: string): Promise<Result<string>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

store typing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants