mirror of
https://github.com/okiba-org/frontend.git
synced 2025-07-06 14:56:33 +00:00
refactor: re-use editor component and other minor changes
This commit is contained in:
16
src/api/bin.ts
Normal file
16
src/api/bin.ts
Normal file
@ -0,0 +1,16 @@
|
||||
export const setPaste = async (code: string): Promise<Response> => {
|
||||
return await fetch("http://localhost:8080/bin/paste", {
|
||||
method: "POST",
|
||||
headers: { "Content-type": "text/plain" },
|
||||
body: code,
|
||||
});
|
||||
};
|
||||
|
||||
export const getPaste = async (pasteId: string) => {
|
||||
return await fetch(`http://localhost:8080/bin/paste/${pasteId}`);
|
||||
};
|
||||
|
||||
export interface SuccessResponse {
|
||||
message: string;
|
||||
endpoint: string;
|
||||
}
|
Reference in New Issue
Block a user