chore: format

This commit is contained in:
Timothy Jaeryang Baek
2024-11-16 23:46:12 -08:00
parent c24bc60d35
commit c338f2cae1
64 changed files with 2668 additions and 1212 deletions
+6 -19
View File
@@ -1,19 +1,13 @@
import { WEBUI_API_BASE_URL } from '$lib/constants';
type PromptItem = {
command: string;
title: string;
content: string;
access_control: null|object;
}
access_control: null | object;
};
export const createNewPrompt = async (
token: string,
prompt: PromptItem
) => {
export const createNewPrompt = async (token: string, prompt: PromptItem) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/prompts/create`, {
@@ -25,7 +19,7 @@ export const createNewPrompt = async (
},
body: JSON.stringify({
...prompt,
command: `/${prompt.command}`,
command: `/${prompt.command}`
})
})
.then(async (res) => {
@@ -76,7 +70,6 @@ export const getPrompts = async (token: string = '') => {
return res;
};
export const getPromptList = async (token: string = '') => {
let error = null;
@@ -108,7 +101,6 @@ export const getPromptList = async (token: string = '') => {
return res;
};
export const getPromptByCommand = async (token: string, command: string) => {
let error = null;
@@ -141,12 +133,7 @@ export const getPromptByCommand = async (token: string, command: string) => {
return res;
};
export const updatePromptByCommand = async (
token: string,
prompt: PromptItem
) => {
export const updatePromptByCommand = async (token: string, prompt: PromptItem) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/prompts/command/${prompt.command}/update`, {
@@ -158,7 +145,7 @@ export const updatePromptByCommand = async (
},
body: JSON.stringify({
...prompt,
command: `/${prompt.command}`,
command: `/${prompt.command}`
})
})
.then(async (res) => {