mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-02-12 01:48:10 -05:00
19 lines
541 B
TypeScript
19 lines
541 B
TypeScript
import axios from "axios";
|
|
import { AppwriteFileWithPreview } from "../types/File.type";
|
|
|
|
const get = async (shareId: string, password?: string) => {
|
|
return (
|
|
await axios.post(`/api/share/${shareId}`, { password })
|
|
).data as AppwriteFileWithPreview[];
|
|
};
|
|
|
|
const authenticateWithPassword = async (shareId: string, password?: string) => {
|
|
return (
|
|
await axios.post(
|
|
`/api/share/${shareId}/enterPassword`,
|
|
{ password }
|
|
)
|
|
).data as AppwriteFileWithPreview[];
|
|
};
|
|
|
|
export default { get, authenticateWithPassword };
|