mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
new marketplace api service
This commit is contained in:
committed by
Aiden McClelland
parent
c4a5cf1c51
commit
2ad5213b44
@@ -2,6 +2,9 @@ import { HttpService } from '../http.service'
|
||||
import { MockApiService } from './mock-api.service'
|
||||
import { LiveApiService } from './live-api.service'
|
||||
import { ConfigService } from '../config.service'
|
||||
import { PatchDbModel } from '../patch-db/patch-db.service'
|
||||
import { MarketplaceLiveApiService } from './marketplace-live-api.service'
|
||||
import { MarketplaceMockApiService } from './marketplace-mock-api.service'
|
||||
|
||||
export function ApiServiceFactory (config: ConfigService, http: HttpService) {
|
||||
if (config.mocks.enabled) {
|
||||
@@ -10,3 +13,11 @@ export function ApiServiceFactory (config: ConfigService, http: HttpService) {
|
||||
return new LiveApiService(config, http)
|
||||
}
|
||||
}
|
||||
|
||||
export function MarketplaceApiServiceFactory (config: ConfigService, http: HttpService, patch: PatchDbModel) {
|
||||
if (config.mocks.enabled) {
|
||||
return new MarketplaceMockApiService(http, patch)
|
||||
} else {
|
||||
return new MarketplaceLiveApiService(http, patch)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user