fix(i18n): load locales from file system, instead of http-backend

This commit is contained in:
Amruth Pillai
2022-03-05 10:08:28 +01:00
parent 7c73685759
commit a4983ac6bc
74 changed files with 105 additions and 142 deletions

View File

@ -6,7 +6,7 @@ const sampleData: Partial<Resume> = {
email: 'alexis.jones@gmail.com',
phone: '+1 800 1200 3820',
photo: {
url: `${process.env.APP_URL}/images/sample-photo.jpg`,
url: `/images/sample-photo.jpg`,
filters: {
size: 128,
shape: 'rounded-square',

View File

@ -31,10 +31,9 @@ export class ResumeService {
async create(createResumeDto: CreateResumeDto, userId: number) {
try {
const user = await this.usersService.findById(userId);
const serverUrl = this.configService.get<string>('app.serverUrl');
const shortId = nanoid(SHORT_ID_LENGTH);
const image = `${serverUrl}/covers/${sample(covers)}`;
const image = `/images/covers/${sample(covers)}`;
const resume = this.resumeRepository.create({
...defaultState,
@ -67,10 +66,9 @@ export class ResumeService {
async import(importResumeDto: Partial<ResumeSchema>, userId: number) {
try {
const user = await this.usersService.findById(userId);
const serverUrl = this.configService.get<string>('app.serverUrl');
const shortId = nanoid(SHORT_ID_LENGTH);
const image = `${serverUrl}/covers/${sample(covers)}`;
const image = `/images/covers/${sample(covers)}`;
const resume = this.resumeRepository.create({
...defaultState,
@ -168,10 +166,9 @@ export class ResumeService {
async duplicate(id: number, userId: number) {
try {
const originalResume = await this.findOne(id, userId);
const serverUrl = this.configService.get<string>('app.serverUrl');
const shortId = nanoid(SHORT_ID_LENGTH);
const image = `${serverUrl}/covers/${sample(covers)}`;
const image = `/images/covers/${sample(covers)}`;
const duplicatedResume: Partial<Resume> = {
...pick(originalResume, ['name', 'slug', 'basics', 'metadata', 'sections', 'public']),