feat(all): upgrade to v3.4.0

This commit is contained in:
Amruth Pillai
2022-04-30 12:58:17 +02:00
parent ccfb4d3cb0
commit 87d381fe8e
61 changed files with 23676 additions and 1291 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,8 @@ import { Font } from '@reactive-resume/schema';
import { get } from 'lodash';
import { firstValueFrom } from 'rxjs';
import cachedResponse from './assets/cachedResponse.json';
@Injectable()
export class FontsService {
constructor(private configService: ConfigService, private httpService: HttpService) {}
@ -13,8 +15,14 @@ export class FontsService {
const apiKey = this.configService.get<string>('google.apiKey');
const url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=' + apiKey;
const response = await firstValueFrom(this.httpService.get(url));
const data = get(response.data, 'items', []);
let data = [];
if (apiKey) {
const response = await firstValueFrom(this.httpService.get(url));
data = get(response.data, 'items', []);
} else {
data = cachedResponse;
}
return data;
}