mirror of
https://github.com/Stef-00012/Zipline-Android-App.git
synced 2025-05-11 18:35:58 +02:00
share intent, other pages
This commit is contained in:
parent
a820c7d7e6
commit
5d4c788db9
18 changed files with 616 additions and 174 deletions
|
@ -8,8 +8,12 @@ import * as FileSystem from "expo-file-system";
|
|||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
interface GetFilesOptions {
|
||||
id?: string;
|
||||
favorite?: boolean;
|
||||
}
|
||||
// GET /api/user/files
|
||||
export async function getFiles(page: string): Promise<APIFiles | null> {
|
||||
export async function getFiles(page: string, options: GetFilesOptions = {}): Promise<APIFiles | null> {
|
||||
const token = db.get("token");
|
||||
const url = db.get("url");
|
||||
|
||||
|
@ -19,6 +23,9 @@ export async function getFiles(page: string): Promise<APIFiles | null> {
|
|||
page: page,
|
||||
});
|
||||
|
||||
if (options.id) params.append("id", options.id);
|
||||
if (options.favorite) params.append("favorite", "true");
|
||||
|
||||
try {
|
||||
const res = await axios.get(`${url}/api/user/files?${params}`, {
|
||||
headers: {
|
||||
|
|
|
@ -44,6 +44,7 @@ export async function createInvite(expiresAt?: string, maxUses?: number): Promis
|
|||
|
||||
return res.data;
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue