#52 完了
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import axios from 'axios'
|
||||
import toCamel from 'camelcase-keys'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Helmet } from 'react-helmet'
|
||||
import { Link, useLocation, useParams } from 'react-router-dom'
|
||||
@@ -18,7 +19,7 @@ export default () => {
|
||||
|
||||
useEffect (() => {
|
||||
void (axios.get (`${ API_BASE_URL }/wiki/changes`, id && { params: { id } })
|
||||
.then (res => setChanges (res.data)))
|
||||
.then (res => setChanges (toCamel (res.data, { deep: true }))))
|
||||
}, [location.search])
|
||||
|
||||
return (
|
||||
@@ -39,19 +40,19 @@ export default () => {
|
||||
{changes.map (change => (
|
||||
<tr key={change.sha}>
|
||||
<td>
|
||||
{change.change_type === 'update' && (
|
||||
<Link to={`/wiki/${ change.wiki_page.id }/diff?from=${ change.pred }&to=${ change.sha }`}>
|
||||
{change.changeType === 'update' && (
|
||||
<Link to={`/wiki/${ change.wikiPage.id }/diff?from=${ change.pred }&to=${ change.sha }`}>
|
||||
差分
|
||||
</Link>)}
|
||||
</td>
|
||||
<td className="p-2">
|
||||
<Link to={`/wiki/${ encodeURIComponent (change.wiki_page.title) }?version=${ change.sha }`}>
|
||||
{change.wiki_page.title}
|
||||
<Link to={`/wiki/${ encodeURIComponent (change.wikiPage.title) }?version=${ change.sha }`}>
|
||||
{change.wikiPage.title}
|
||||
</Link>
|
||||
</td>
|
||||
<td className="p-2">
|
||||
{(() => {
|
||||
switch (change.change_type)
|
||||
switch (change.changeType)
|
||||
{
|
||||
case 'create':
|
||||
return '新規'
|
||||
|
||||
Reference in New Issue
Block a user