feat: D & D による上位タグ設定(#184) #186

Merged
みてるぞ merged 17 commits from feature/184 into main 2026-01-07 03:26:06 +09:00
2 changed files with 13 additions and 3 deletions
Showing only changes of commit b138a6a45f - Show all commits
+1
View File
@@ -6,6 +6,7 @@ class NicoTagRelation < ApplicationRecord
validates :tag_id, presence: true validates :tag_id, presence: true
validate :nico_tag_must_be_nico validate :nico_tag_must_be_nico
validate :tag_mustnt_be_nico
private private
+10 -1
View File
@@ -36,9 +36,16 @@ export default () => {
if (/^\d+$/.test (title)) if (/^\d+$/.test (title))
{ {
void (async () => { void (async () => {
try
{
const res = await axios.get (`${ API_BASE_URL }/wiki/${ title }`) const res = await axios.get (`${ API_BASE_URL }/wiki/${ title }`)
const data = res.data as WikiPage const data = res.data as WikiPage
navigate (`/wiki/${ data.title }`, { replace: true }) navigate (`/wiki/${ encodeURIComponent(data.title) }`, { replace: true })
}
catch
{
;
}
}) () }) ()
return return
@@ -51,6 +58,8 @@ export default () => {
`${ API_BASE_URL }/wiki/title/${ encodeURIComponent (title) }`, `${ API_BASE_URL }/wiki/title/${ encodeURIComponent (title) }`,
{ params: version ? { version } : { } }) { params: version ? { version } : { } })
const data = toCamel (res.data as any, { deep: true }) as WikiPage const data = toCamel (res.data as any, { deep: true }) as WikiPage
if (data.title !== title)
navigate (`/wiki/${ encodeURIComponent(data.title) }`, { replace: true })
setWikiPage (data) setWikiPage (data)
WikiIdBus.set (data.id) WikiIdBus.set (data.id)
} }