Browse Source

軽いバグ修正

#23
みてるぞ 1 day ago
parent
commit
8222ed233e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      frontend/src/components/PostEditForm.tsx

+ 2
- 1
frontend/src/components/PostEditForm.tsx View File

@@ -1,4 +1,5 @@
import axios from 'axios'
import toCamel from 'camelcase-keys'
import { useState } from 'react'

import TextArea from '@/components/common/TextArea'
@@ -22,7 +23,7 @@ export default ({ post, onSave }: Props) => {
const res = await axios.put (`${ API_BASE_URL }/posts/${ post.id }`, { title, tags },
{ headers: { 'Content-Type': 'multipart/form-data',
'X-Transfer-Code': localStorage.getItem ('user_code') || '' } } )
const data = res.data as Post
const data = toCamel (res.data as any, { deep: true }) as Post
onSave ({ ...post,
title: data.title,
tags: data.tags } as Post)


Loading…
Cancel
Save