mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 20:59:05 +00:00
Added feature for "sendToZulip", fixed visual issue, .gitignore for db dump files
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
import axios from "axios";
|
||||
import { URLSearchParams } from "url";
|
||||
import { featureEnabled } from "../../app/[domain]/domainContext";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
if (req.method === "POST") {
|
||||
const { stream, topic, message } = req.body;
|
||||
console.log("Sending zulip message", stream, topic);
|
||||
|
||||
if (!stream || !topic || !message) {
|
||||
return res.status(400).json({ error: "Missing required parameters" });
|
||||
}
|
||||
|
||||
if (!featureEnabled("sendToZulip")) {
|
||||
return res.status(403).json({ error: "Zulip integration disabled" });
|
||||
}
|
||||
|
||||
try {
|
||||
// Construct URL-encoded data
|
||||
const params = new URLSearchParams();
|
||||
|
||||
Reference in New Issue
Block a user