reedo types
This commit is contained in:
@@ -5,13 +5,23 @@ import InputError from '@/components/InputError.vue';
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { nameToSlug } from '@/routes/teams';
|
import { nameToSlug } from '@/routes/teams';
|
||||||
import type {
|
|
||||||
TeamSlugProps,
|
|
||||||
TeamSlugRequest,
|
|
||||||
TeamSlugResponse,
|
|
||||||
} from '@/types/team';
|
|
||||||
|
|
||||||
const props = defineProps<TeamSlugProps>();
|
type TeamSlugRequest = {
|
||||||
|
name: string;
|
||||||
|
ignored_slug: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
type TeamSlugResponse = {
|
||||||
|
name: string;
|
||||||
|
slug: string;
|
||||||
|
taken: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
name: string;
|
||||||
|
ignoredSlug?: string;
|
||||||
|
error?: string;
|
||||||
|
}>();
|
||||||
const slug = defineModel<string>('slug', { required: true });
|
const slug = defineModel<string>('slug', { required: true });
|
||||||
const slugTaken = defineModel<boolean>('slugTaken', { required: true });
|
const slugTaken = defineModel<boolean>('slugTaken', { required: true });
|
||||||
const previewError = ref('');
|
const previewError = ref('');
|
||||||
|
|||||||
@@ -7,12 +7,14 @@ import { Input } from '@/components/ui/input';
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import InputError from '@/components/InputError.vue';
|
import InputError from '@/components/InputError.vue';
|
||||||
import { Checkbox } from '@/components/ui/checkbox';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
import type { TeamEditPageProps } from '@/types/page-props';
|
import type { Team } from '@/types/models';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import TeamSlug from '@/components/TeamSlug.vue';
|
import TeamSlug from '@/components/TeamSlug.vue';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
|
|
||||||
const props = defineProps<TeamEditPageProps>();
|
const props = defineProps<{
|
||||||
|
team: Team;
|
||||||
|
}>();
|
||||||
|
|
||||||
setLayoutProps({
|
setLayoutProps({
|
||||||
breadcrumbs: [
|
breadcrumbs: [
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import teamRoutes from '@/routes/teams';
|
import teamRoutes from '@/routes/teams';
|
||||||
import { Head, Link, router, usePage } from '@inertiajs/vue3';
|
import { Head, Link, router, usePage } from '@inertiajs/vue3';
|
||||||
import type { Team } from '@/types/models';
|
import type { Team } from '@/types/models';
|
||||||
import type { TeamIndexPageProps } from '@/types/page-props';
|
|
||||||
import TextLink from '@/components/TextLink.vue';
|
import TextLink from '@/components/TextLink.vue';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import {
|
import {
|
||||||
@@ -28,7 +27,9 @@ defineOptions({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
defineProps<TeamIndexPageProps>();
|
defineProps<{
|
||||||
|
teams: Team[];
|
||||||
|
}>();
|
||||||
|
|
||||||
const user = usePage().props.auth.user;
|
const user = usePage().props.auth.user;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import teamRoutes from '@/routes/teams';
|
import teamRoutes from '@/routes/teams';
|
||||||
import { Head, Link, setLayoutProps, useForm } from '@inertiajs/vue3';
|
import { Head, Link, setLayoutProps, useForm } from '@inertiajs/vue3';
|
||||||
import type { TeamInvite } from '@/types/models';
|
import type { Team, TeamInvite } from '@/types/models';
|
||||||
import type { TeamShowPageProps } from '@/types/page-props';
|
|
||||||
import InputError from '@/components/InputError.vue';
|
import InputError from '@/components/InputError.vue';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import {
|
import {
|
||||||
@@ -16,7 +15,11 @@ import {
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Pencil, Trash } from '@lucide/vue';
|
import { Pencil, Trash } from '@lucide/vue';
|
||||||
|
|
||||||
const props = defineProps<TeamShowPageProps>();
|
const props = defineProps<{
|
||||||
|
team: Team;
|
||||||
|
canManageTeam: boolean;
|
||||||
|
teamInvites?: TeamInvite[];
|
||||||
|
}>();
|
||||||
|
|
||||||
setLayoutProps({
|
setLayoutProps({
|
||||||
breadcrumbs: [
|
breadcrumbs: [
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
import type { Team, TeamInvite } from '@/types/models';
|
|
||||||
|
|
||||||
export type TeamEditPageProps = {
|
|
||||||
team: Team;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TeamShowPageProps = {
|
|
||||||
team: Team;
|
|
||||||
canManageTeam: boolean;
|
|
||||||
teamInvites?: TeamInvite[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TeamIndexPageProps = {
|
|
||||||
teams: Team[];
|
|
||||||
};
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
export type TeamSlugProps = {
|
|
||||||
name: string;
|
|
||||||
ignoredSlug?: string;
|
|
||||||
error?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TeamSlugRequest = {
|
|
||||||
name: string;
|
|
||||||
ignored_slug: string | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TeamSlugResponse = {
|
|
||||||
name: string;
|
|
||||||
slug: string;
|
|
||||||
taken: boolean;
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user