feat: add short link to edit link response
Enhances link edit endpoint by including a fully-qualified short link URL in the response, constructed from request protocol and host alongside the slug
This commit is contained in:
parent
337f8f174c
commit
e7d71b35d3
1 changed files with 2 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ export default eventHandler(async (event) => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
setResponseStatus(event, 201)
|
setResponseStatus(event, 201)
|
||||||
return { link: newLink }
|
const shortLink = `${getRequestProtocol(event)}://${getRequestHost(event)}/${link.slug}`
|
||||||
|
return { link: newLink, shortLink }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue