From cb441df58bfc953485c16d5fcb8c5c272fc50543 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 8 Jan 2023 03:17:12 +0100 Subject: [PATCH] Created the link module --- modules/link/module.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 modules/link/module.js diff --git a/modules/link/module.js b/modules/link/module.js new file mode 100644 index 0000000..bdc8d52 --- /dev/null +++ b/modules/link/module.js @@ -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" + } + } + }] +}