mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 15:35:35 +00:00
refactor: create types instead of using models
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import type Collection from '#models/collection';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { route } from '@izzyjs/route/client';
|
||||
import { useMemo } from 'react';
|
||||
@@ -6,6 +5,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import FormLink from '~/components/form/form_link';
|
||||
import useSearchParam from '~/hooks/use_search_param';
|
||||
import { isValidHttpUrl } from '~/lib/navigation';
|
||||
import { Collection } from '~/types/app';
|
||||
|
||||
export default function CreateLinkPage({
|
||||
collections,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type Link from '#models/link';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { route } from '@izzyjs/route/client';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FormLink from '~/components/form/form_link';
|
||||
import { LinkWithCollection } from '~/types/app';
|
||||
|
||||
export default function DeleteLinkPage({ link }: { link: Link }) {
|
||||
export default function DeleteLinkPage({ link }: { link: LinkWithCollection }) {
|
||||
const { t } = useTranslation('common');
|
||||
const { data, setData, submit, processing } = useForm({
|
||||
name: link.name,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import type Collection from '#models/collection';
|
||||
import type Link from '#models/link';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { route } from '@izzyjs/route/client';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FormLink from '~/components/form/form_link';
|
||||
import { isValidHttpUrl } from '~/lib/navigation';
|
||||
import { Collection, Link } from '~/types/app';
|
||||
|
||||
export default function EditLinkPage({
|
||||
collections,
|
||||
|
||||
Reference in New Issue
Block a user