mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
remove file uploads from config
This commit is contained in:
@@ -14,8 +14,6 @@ export abstract class ApiService {
|
||||
// for sideloading packages
|
||||
abstract uploadPackage(guid: string, body: Blob): Promise<string>
|
||||
|
||||
abstract uploadFile(body: Blob): Promise<string>
|
||||
|
||||
// for getting static files: ex icons, instructions, licenses
|
||||
abstract getStaticProxy(
|
||||
pkg: MarketplacePkg,
|
||||
|
||||
@@ -52,15 +52,6 @@ export class LiveApiService extends ApiService {
|
||||
})
|
||||
}
|
||||
|
||||
async uploadFile(body: Blob): Promise<string> {
|
||||
return this.httpRequest({
|
||||
method: Method.POST,
|
||||
body,
|
||||
url: `/rest/upload`,
|
||||
responseType: 'text',
|
||||
})
|
||||
}
|
||||
|
||||
// for getting static files: ex. instructions, licenses
|
||||
|
||||
async getStaticProxy(
|
||||
|
||||
@@ -1084,11 +1084,6 @@ export class MockApiService extends ApiService {
|
||||
}
|
||||
}
|
||||
|
||||
async uploadFile(body: Blob): Promise<string> {
|
||||
await pauseFor(2000)
|
||||
return 'returnedhash'
|
||||
}
|
||||
|
||||
private async initProgress(): Promise<T.FullProgress> {
|
||||
const progress = JSON.parse(JSON.stringify(PROGRESS))
|
||||
|
||||
|
||||
@@ -122,11 +122,6 @@ export class FormService {
|
||||
return this.getListItem(spec, entry)
|
||||
})
|
||||
return this.formBuilder.array(mapped, listValidators(spec))
|
||||
case 'file':
|
||||
return this.formBuilder.control(
|
||||
currentValue || null,
|
||||
fileValidators(spec),
|
||||
)
|
||||
case 'union':
|
||||
const currentSelection = currentValue?.selection
|
||||
const isValid = !!spec.variants[currentSelection]
|
||||
@@ -259,16 +254,6 @@ function listValidators(spec: CT.ValueSpecList): ValidatorFn[] {
|
||||
return validators
|
||||
}
|
||||
|
||||
function fileValidators(spec: CT.ValueSpecFile): ValidatorFn[] {
|
||||
const validators: ValidatorFn[] = []
|
||||
|
||||
if (spec.required) {
|
||||
validators.push(Validators.required)
|
||||
}
|
||||
|
||||
return validators
|
||||
}
|
||||
|
||||
export function numberInRange(
|
||||
min: number | null,
|
||||
max: number | null,
|
||||
|
||||
Reference in New Issue
Block a user