mirror of
https://github.com/idanoo/autobrr
synced 2025-07-24 17:29:12 +00:00
chore(web): relocations and cleanups (#957)
* delete manifest (vite-plugin-pwa generates it) * fix upper case letter on screen components * fix imports of screens components missing upper case * remove default export from Base.tsx * move RegexPlayground to settings import * replace some relative path imports * remove React and ununsed imports * small alignments on vite.config.ts * move Dashboard and Releases to screens * move filters/index.tsx to filters/index.ts * remove default export from APIKeyAddForm * remove default export from FilterAddForm * organize imports and exports for the router * add .vscode workspace to gitignore * some touchs on .gitignore file * fix some eslint rules
This commit is contained in:
parent
72bb2ddadb
commit
c7ec93722b
41 changed files with 187 additions and 230 deletions
|
@ -21,20 +21,20 @@ interface apiKeyAddFormProps {
|
|||
toggle: () => void;
|
||||
}
|
||||
|
||||
function APIKeyAddForm({ isOpen, toggle }: apiKeyAddFormProps) {
|
||||
export function APIKeyAddForm({ isOpen, toggle }: apiKeyAddFormProps) {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const mutation = useMutation({
|
||||
mutationFn: (apikey: APIKey) => APIClient.apikeys.create(apikey),
|
||||
onSuccess: (_, key) => {
|
||||
queryClient.invalidateQueries({ queryKey: apiKeys.lists() });
|
||||
|
||||
|
||||
toast.custom((t) => <Toast type="success" body={`API key ${key.name} was added`} t={t}/>);
|
||||
|
||||
toggle();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const handleSubmit = (data: unknown) => mutation.mutate(data as APIKey);
|
||||
const validate = (values: FormikValues) => {
|
||||
const errors = {} as FormikErrors<FormikValues>;
|
||||
|
@ -156,5 +156,3 @@ function APIKeyAddForm({ isOpen, toggle }: apiKeyAddFormProps) {
|
|||
</Transition.Root>
|
||||
);
|
||||
}
|
||||
|
||||
export default APIKeyAddForm;
|
Loading…
Add table
Add a link
Reference in a new issue