Created the link module

This commit is contained in:
2023-01-08 03:17:12 +01:00
parent f87f28b35e
commit cb441df58b

23
modules/link/module.js Normal file
View File

@ -0,0 +1,23 @@
const Joi = require("joi");
// Redirects the user to the provided shortenUrl
module.exports.onClick = (id, accessId, metaData, controller) => controller.redirect(metaData.shortenUrl);
module.exports.info = {
name: "Link kürzen",
icon: "link",
validationSchema: Joi.object({
shortenUrl: Joi.string().max(2500).uri().required()
}),
meta: [{
name: "Link-Einstellungen",
type: "default",
fields: {
shortenUrl: {
type: "text",
name: "Zu kürzende URL",
description: "Die zu kürzende (lange) URL"
}
}
}]
}