mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 11:12:23 +01:00
9.1.4
This commit is contained in:
27
backend/structure/affiliate.js
Normal file
27
backend/structure/affiliate.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const Express = require("express");
|
||||
const express = Express.Router();
|
||||
|
||||
express.get("/affiliate/api/public/affiliates/slug/:slug", async (req, res) => {
|
||||
const SupportedCodes = require("./../responses/SAC.json");
|
||||
var ValidCode = false;
|
||||
|
||||
SupportedCodes.forEach(code => {
|
||||
if (req.params.slug.toLowerCase() == code.toLowerCase()) {
|
||||
ValidCode = true;
|
||||
return res.json({
|
||||
"id": code,
|
||||
"slug": code,
|
||||
"displayName": code,
|
||||
"status": "ACTIVE",
|
||||
"verified": false
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
if (ValidCode == false) {
|
||||
res.status(404);
|
||||
res.json({});
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = express;
|
||||
Reference in New Issue
Block a user