fix(menu): pass baseUrl to backend for accurate base tag injection
parent
205af45b72
commit
0860b3866b
|
|
@ -119,7 +119,7 @@ export class CreateMenuComponent implements OnInit {
|
|||
this.fileContent = base64Content;
|
||||
|
||||
// Ask the backend to compile a preview using this encoded Twig
|
||||
this.dataService.previewMenuTemplate(base64Content).subscribe({
|
||||
this.dataService.previewMenuTemplate(base64Content, this.baseUrl).subscribe({
|
||||
next: (renderedHtml) => {
|
||||
const renderedBytes = new TextEncoder().encode(renderedHtml);
|
||||
const renderedBinaryStr = Array.from(renderedBytes).map(byte => String.fromCharCode(byte)).join('');
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ export class DataService {
|
|||
);
|
||||
}
|
||||
|
||||
previewMenuTemplate(base64Template: string): Observable<string> {
|
||||
previewMenuTemplate(base64Template: string, baseUrl?: string): Observable<string> {
|
||||
const url = `${this.baseUrl}/menu-preview`;
|
||||
return this.http.post(url, { templateBase64: base64Template }, { responseType: 'text' }).pipe(
|
||||
return this.http.post(url, { templateBase64: base64Template, baseUrl: baseUrl }, { responseType: 'text' }).pipe(
|
||||
catchError(error => {
|
||||
console.error(this.translate.instant('errorPreviewingMenuTemplate'), error);
|
||||
return throwError(() => error);
|
||||
|
|
|
|||
Loading…
Reference in New Issue