forked from OwnZones/orchestration-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
599 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/app/api/manager/ingests/source_id/[ingest_name]/[ingest_source_name]/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/app/api/manager/productions/[id]/sources/[source_id]/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
import { isAuthenticated } from '../../../../../../../api/manager/auth'; | ||
import { replaceProductionSourceStreamIds } from '../../../../../../../api/manager/productions'; | ||
import { Log } from '../../../../../../../api/logger'; | ||
|
||
type Params = { | ||
id: string; | ||
source_id: string; | ||
}; | ||
|
||
export async function PUT( | ||
request: NextRequest, | ||
{ params }: { params: Params } | ||
): Promise<NextResponse> { | ||
if (!(await isAuthenticated())) { | ||
return new NextResponse(`Not Authorized!`, { | ||
status: 403 | ||
}); | ||
} | ||
|
||
try { | ||
const body = (await request.json()) as { stream_uuids: string[] }; | ||
const prod = await replaceProductionSourceStreamIds( | ||
params.id, | ||
params.source_id, | ||
body.stream_uuids | ||
); | ||
return new NextResponse(JSON.stringify(prod), { status: 200 }); | ||
} catch (error) { | ||
Log().warn('Could not update production source stream ids', error); | ||
|
||
return new NextResponse(`Error searching DB! Error: ${error}`, { | ||
status: 500 | ||
}); | ||
} | ||
} |
Oops, something went wrong.