fix: refine link creation response structure

Returns link object separately from shortLink in response to maintain clearer API structure and prevent unnecessary data duplication in the response payload
This commit is contained in:
ccbikai 2024-12-08 12:01:17 +08:00
parent 172956b532
commit 337f8f174c

View file

@ -24,6 +24,6 @@ export default eventHandler(async (event) => {
})
setResponseStatus(event, 201)
const shortLink = `${getRequestProtocol(event)}://${getRequestHost(event)}/${link.slug}`
return { ...link, shortLink }
return { link, shortLink }
}
})