File size: 882 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
29
import { addQueryArgs } from 'calypso/lib/url';

interface CreateDeploymentRouteParams {
	installationId?: number;
	repositoryId?: number;
}

export const indexPage = ( siteSlug: string ) => `/github-deployments/${ siteSlug }`;

export const createPage = ( siteSlug: string ) => `${ indexPage( siteSlug ) }/create`;

export const createDeploymentPage = (
	siteSlug: string,
	{ installationId, repositoryId }: CreateDeploymentRouteParams = {}
) => {
	return addQueryArgs(
		{ installation_id: installationId, repository_id: repositoryId },
		`${ indexPage( siteSlug ) }/create`
	);
};

export const manageDeploymentPage = ( siteSlug: string, deploymentId: number ) => {
	return `${ indexPage( siteSlug ) }/manage/${ deploymentId }`;
};

export const viewDeploymentLogs = ( siteSlug: string, deploymentId: number ) => {
	return `${ indexPage( siteSlug ) }/logs/${ deploymentId }`;
};