parent
f6b2ae523d
commit
33d7c94648
|
@ -127,6 +127,7 @@ const newUrlSchema = {
|
|||
properties: {
|
||||
target: { type: 'string' },
|
||||
shortcode: { type: 'string' },
|
||||
no_preview: { type: 'boolean' },
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -135,6 +136,7 @@ const newUrlSchema = {
|
|||
fastify.post('/api', { newUrlSchema }, async (req, res) => {
|
||||
const target = req.body?.target;
|
||||
let shortcode = req.body?.shortcode;
|
||||
let no_preview = req.body?.no_preview || false;
|
||||
|
||||
//Check if the user provided a target
|
||||
if (!target) {
|
||||
|
@ -190,7 +192,8 @@ fastify.post('/api', { newUrlSchema }, async (req, res) => {
|
|||
return {
|
||||
url: `${config.getBaseUrl()}/${shortcode}`,
|
||||
shortcode,
|
||||
target
|
||||
target,
|
||||
no_preview
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue