릴리스: v1.4.32 내부 이름층 topic/template 정리 마감

This commit is contained in:
2026-04-02 21:50:36 +09:00
parent 60cc5a72c5
commit 85863b1b36
14 changed files with 125 additions and 114 deletions

View File

@@ -128,7 +128,7 @@ router.post('/templates', requireAdmin, async (req, res) => {
if (exists) return res.status(409).json({ error: 'topic_id_taken' })
const template = await createTopic({ id: parsed.data.id, name: parsed.data.name, isPublic: parsed.data.isPublic })
if (parsed.data.thumbnailSrc) {
const copiedThumb = await copyUploadIntoGameAsset(parsed.data.thumbnailSrc)
const copiedThumb = await copyUploadIntoTopicAsset(parsed.data.thumbnailSrc)
await updateTopicThumbnail(template.id, copiedThumb)
}
const savedTemplate = await findTopicById(template.id)
@@ -469,7 +469,7 @@ async function promoteLibraryItemToTemplateItem({ item, templateId }) {
})
}
async function copyUploadIntoGameAsset(src) {
async function copyUploadIntoTopicAsset(src) {
if (typeof src !== 'string') return ''
const raw = src.trim()
if (!raw) return ''
@@ -507,7 +507,7 @@ async function promoteTierListItemsToTemplate({ tierList, templateId, itemIds =
const createdItems = []
for (const item of itemsToCopy) {
const copiedSrc = await copyUploadIntoGameAsset(item.src)
const copiedSrc = await copyUploadIntoTopicAsset(item.src)
createdItems.push(
await createTopicItem({
id: nanoid(),
@@ -531,7 +531,7 @@ async function promoteSnapshotItemsToTemplate({ items, templateId }) {
const createdItems = []
for (const item of items || []) {
const copiedSrc = await copyUploadIntoGameAsset(item.src)
const copiedSrc = await copyUploadIntoTopicAsset(item.src)
if (!copiedSrc || existingSrcs.has(copiedSrc)) continue
createdItems.push(
await createTopicItem({
@@ -576,13 +576,13 @@ function pickTemplateRequestItems(templateRequest, itemIds = [], itemLabels = {}
async function createTemplateFromTierList({ tierList, templateId, templateName }) {
await createTopic({ id: templateId, name: templateName, isPublic: false })
if (tierList.thumbnailSrc) {
const copiedThumb = await copyUploadIntoGameAsset(tierList.thumbnailSrc)
const copiedThumb = await copyUploadIntoTopicAsset(tierList.thumbnailSrc)
await updateTopicThumbnail(templateId, copiedThumb)
}
const createdItems = []
for (const item of uniqueTierListPoolItems(tierList)) {
const copiedSrc = await copyUploadIntoGameAsset(item.src)
const copiedSrc = await copyUploadIntoTopicAsset(item.src)
createdItems.push(
await createTopicItem({
id: nanoid(),
@@ -600,7 +600,7 @@ async function createTemplateFromRequest({ templateRequest, templateId, template
await createTopic({ id: templateId, name: templateName, isPublic: false })
if (templateRequest.thumbnailSrc) {
const copiedThumb = await copyUploadIntoGameAsset(templateRequest.thumbnailSrc)
const copiedThumb = await copyUploadIntoTopicAsset(templateRequest.thumbnailSrc)
await updateTopicThumbnail(templateId, copiedThumb)
}