config service not in constructor

This commit is contained in:
Drew Ansbacher
2021-07-13 14:16:31 -06:00
committed by Aiden McClelland
parent dc71a625b2
commit 3b365bfb63

View File

@@ -10,7 +10,7 @@ import { Mock } from './mock-app-fixures'
import { HttpService, Method } from '../http.service' import { HttpService, Method } from '../http.service'
import markdown from 'raw-loader!src/assets/markdown/md-sample.md' import markdown from 'raw-loader!src/assets/markdown/md-sample.md'
import { ConfigService } from '../config.service' import { ConfigService } from '../config.service'
const configService = new ConfigService()
@Injectable() @Injectable()
export class MockApiService extends ApiService { export class MockApiService extends ApiService {
sequence = 0 sequence = 0
@@ -18,7 +18,6 @@ export class MockApiService extends ApiService {
constructor ( constructor (
private readonly http: HttpService, private readonly http: HttpService,
private readonly configService: ConfigService,
) { super() } ) { super() }
// every time a patch is returned from the mock, we override its sequence to be 1 more than the last sequence in the patch-db as provided by `o`. // every time a patch is returned from the mock, we override its sequence to be 1 more than the last sequence in the patch-db as provided by `o`.
@@ -474,8 +473,8 @@ export class MockApiService extends ApiService {
// marketplace // marketplace
async getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes> { async getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes> {
const registryURL = this.configService.mocks.registryURL const registryURL = configService.mocks.registryURL
if(!registryURL) { if (!registryURL) {
await pauseFor(2000) await pauseFor(2000)
return { return {
categories: ['featured', 'bitcoin', 'lightning', 'data', 'messaging', 'social', 'alt coin'], categories: ['featured', 'bitcoin', 'lightning', 'data', 'messaging', 'social', 'alt coin'],
@@ -487,8 +486,8 @@ export class MockApiService extends ApiService {
} }
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> { async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
const registryURL = this.configService.mocks.registryURL const registryURL = configService.mocks.registryURL
if(!registryURL) { if (!registryURL) {
await pauseFor(2000) await pauseFor(2000)
return Mock.MarketplaceEos return Mock.MarketplaceEos
} }
@@ -500,8 +499,8 @@ export class MockApiService extends ApiService {
} }
async getAvailableList (params: RR.GetAvailableListReq): Promise<RR.GetAvailableListRes> { async getAvailableList (params: RR.GetAvailableListReq): Promise<RR.GetAvailableListRes> {
const registryURL = this.configService.mocks.registryURL const registryURL = configService.mocks.registryURL
if(!registryURL) { if (!registryURL) {
await pauseFor(2000) await pauseFor(2000)
return Mock.AvailableList return Mock.AvailableList
} }
@@ -511,8 +510,8 @@ export class MockApiService extends ApiService {
} }
async getAvailableShow (params: RR.GetAvailableShowReq): Promise<RR.GetAvailableShowRes> { async getAvailableShow (params: RR.GetAvailableShowReq): Promise<RR.GetAvailableShowRes> {
const registryURL = this.configService.mocks.registryURL const registryURL = configService.mocks.registryURL
if(!registryURL) { if (!registryURL) {
await pauseFor(2000) await pauseFor(2000)
return Mock.AvailableShow[params.id][params.version || 'latest'] return Mock.AvailableShow[params.id][params.version || 'latest']
} }