mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 14:43:25 +00:00
remove ofetch, replace with fetch
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import { ofetch } from "ofetch";
|
||||
|
||||
import type { AccountWithToken, BookmarkInput, ProgressInput } from "./types";
|
||||
import { getAuthHeaders } from "./auth";
|
||||
import { f } from "./fetch";
|
||||
|
||||
export function importProgress(
|
||||
url: string,
|
||||
account: AccountWithToken,
|
||||
progressItems: ProgressInput[],
|
||||
) {
|
||||
return ofetch<void>(`/users/${account.userId}/progress/import`, {
|
||||
return f<void>(`/users/${account.userId}/progress/import`, {
|
||||
method: "PUT",
|
||||
body: progressItems,
|
||||
baseURL: url,
|
||||
baseUrl: url,
|
||||
headers: getAuthHeaders(account.token),
|
||||
});
|
||||
}
|
||||
@@ -21,10 +20,10 @@ export function importBookmarks(
|
||||
account: AccountWithToken,
|
||||
bookmarks: BookmarkInput[],
|
||||
) {
|
||||
return ofetch<void>(`/users/${account.userId}/bookmarks`, {
|
||||
return f<void>(`/users/${account.userId}/bookmarks`, {
|
||||
method: "PUT",
|
||||
body: bookmarks,
|
||||
baseURL: url,
|
||||
baseUrl: url,
|
||||
headers: getAuthHeaders(account.token),
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user