File size: 971 Bytes
c993983
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import client from './client';
import type { Stream } from '../types/stream';

export async function addStream(projectId: string, procIdx: number, stream?: Stream) {
  const res = await client.post(`/api/procs/${projectId}/${procIdx}/streams`, stream ?? null);
  return res.data;
}

export async function updateStream(projectId: string, procIdx: number, streamIdx: number, stream: Stream) {
  const res = await client.put(`/api/streams/${projectId}/${procIdx}/${streamIdx}`, stream);
  return res.data;
}

export async function deleteStream(projectId: string, procIdx: number, streamIdx: number) {
  const res = await client.delete(`/api/streams/${projectId}/${procIdx}/${streamIdx}`);
  return res.data;
}

export async function addChildStream(
  projectId: string, procIdx: number, childIdx: number, stream?: Stream
) {
  const res = await client.post(
    `/api/procs/${projectId}/${procIdx}/children/${childIdx}/streams`,
    stream ?? null
  );
  return res.data;
}