Working on Standartisation.... #TODO
This commit is contained in:
1 parent
da4d67ea47
commit
bdc864cf94
8 files changed
+104
-36
No files matched your search
@@ -1,8 +1,6 @@
|
||||
// @wikiCategory: Stream
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { getSongById } from "@/lib/db/song";
|
||||
import { getSongBookById } from "@/lib/db/songbook";
|
||||
|
||||
|
||||
let currentSong = {
|
||||
@@ -58,8 +56,9 @@ export async function POST(request: Request) {
|
||||
number
|
||||
};
|
||||
|
||||
const payload = JSON.stringify(currentSong);
|
||||
clients.forEach((send) => send(payload));
|
||||
clients.forEach((controller) => {
|
||||
controller.enqueue(`data: ${JSON.stringify(currentSong)}\n\n`);
|
||||
});
|
||||
|
||||
return NextResponse.json({ success: true , currentSong }, { status: 200 });
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user