Created the link module
This commit is contained in:
23
modules/link/module.js
Normal file
23
modules/link/module.js
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
Reference in New Issue
Block a user