feat : add frontend deploy types and service
This commit is contained in:
13
frontend/services/deploy.ts
Normal file
13
frontend/services/deploy.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import type { TagListResponse, DeployResult } from './dto/deploy'
|
||||||
|
|
||||||
|
export function getAvailableTags(slug: string): Promise<TagListResponse> {
|
||||||
|
return useApi().get<TagListResponse>(`/applications/${slug}/tags`, undefined, {
|
||||||
|
toast: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deploy(envId: number, tag: string): Promise<DeployResult> {
|
||||||
|
return useApi().post<DeployResult>(`/environments/${envId}/deploy`, { tag }, {
|
||||||
|
toast: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
9
frontend/services/dto/deploy.ts
Normal file
9
frontend/services/dto/deploy.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
type TagListResponse = {
|
||||||
|
tags: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeployResult = {
|
||||||
|
success: boolean
|
||||||
|
output: string
|
||||||
|
tag: string
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user