Skip to content

Commit

Permalink
Merge branch 'feature/authjs' of github.com:shapehq/shape-docs into f…
Browse files Browse the repository at this point in the history
…eature/authjs
  • Loading branch information
simonbs committed Jun 25, 2024
2 parents 8958793 + b44ceb7 commit 4f9649f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/features/admin/view/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { z } from 'zod'

const sendInviteSchema = z.object({
email: z.string().email(),
projects: z.string().transform(v => v.trim().split(","))
projects: z.string().min(1).transform(v => v.trim().split(","))
})

export interface SendInviteResult {
Expand All @@ -25,7 +25,7 @@ export const sendInvite = async (prevState: any, formData: FormData): Promise<Se

if (!validatedFields.success) {
return {
error: 'Validation failed',
error: validatedFields.error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', '),
success: false,
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/features/admin/view/AdminPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Box, ButtonGroup, Chip, Paper, TableBody, TableCell, TableContainer, Ta
import Table from "@mui/material/Table"
import { InviteGuestForm } from "./InviteGuestForm"
import { RemoveGuestForm } from "./RemoveGuestForm"
import { EditGuestForm } from "./EditGuestForm"

const AdminPage = async () => {
const guests = await guestRepository.getAll()
Expand Down Expand Up @@ -42,6 +43,7 @@ const AdminPage = async () => {
<TableCell>{row.projects.join(", ")}</TableCell>
<TableCell>
<ButtonGroup variant="outlined">
<EditGuestForm />
<RemoveGuestForm email={row.email} />
</ButtonGroup>
</TableCell>
Expand Down
11 changes: 11 additions & 0 deletions src/features/admin/view/EditGuestForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use client'

import { Button } from "@mui/material";

export const EditGuestForm = () => {
return (
<form>
<Button>Edit</Button>
</form>
)
}

0 comments on commit 4f9649f

Please sign in to comment.