このコミットが含まれているのは:
@@ -6,6 +6,7 @@ import Label from '@/components/common/Label'
|
||||
import { useDialogue } from '@/components/dialogues/DialogueProvider'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { toast } from '@/components/ui/use-toast'
|
||||
import { isApiError } from '@/lib/api'
|
||||
import { updatePost } from '@/lib/posts'
|
||||
|
||||
import type { FC, FormEvent } from 'react'
|
||||
@@ -32,7 +33,7 @@ type Props = { post: Post
|
||||
onSave: (newPost: Post) => void }
|
||||
|
||||
|
||||
export default (({ post, onSave }: Props) => {
|
||||
const PostEditForm: FC<Props> = ({ post, onSave }) => {
|
||||
const [disabled, setDisabled] = useState (false)
|
||||
const [originalCreatedBefore, setOriginalCreatedBefore] =
|
||||
useState<string | null> (post.originalCreatedBefore)
|
||||
@@ -62,7 +63,7 @@ export default (({ post, onSave }: Props) => {
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
const response = (e as any)?.response
|
||||
const response = isApiError<{ mergeable?: boolean }> (e) ? e.response : undefined
|
||||
|
||||
if (response?.status !== 409)
|
||||
{
|
||||
@@ -164,4 +165,6 @@ export default (({ post, onSave }: Props) => {
|
||||
更新
|
||||
</Button>
|
||||
</form>)
|
||||
}) satisfies FC<Props>
|
||||
}
|
||||
|
||||
export default PostEditForm
|
||||
新しい課題から参照
ユーザをブロックする