Fix bug of preview content.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export interface PreviewContentRequest {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface PreviewContentResponse {
|
||||
text: string;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { last, lastValueFrom } from 'rxjs';
|
||||
import { Publication } from './model/publication';
|
||||
import { PreviewContentRequest, PreviewContentResponse } from './model/preview';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -31,9 +32,8 @@ export class PublicationRestService {
|
||||
return lastValueFrom(this.httpClient.get<Publication[]>('/api/publications', { params }));
|
||||
}
|
||||
|
||||
preview(publicationText: string): Promise<string> {
|
||||
const request = { text: publicationText };
|
||||
return lastValueFrom(this.httpClient.post<string>('/api/publications/preview', request));
|
||||
preview(request: PreviewContentRequest): Promise<PreviewContentResponse> {
|
||||
return lastValueFrom(this.httpClient.post<PreviewContentResponse>('/api/publications/preview', request));
|
||||
}
|
||||
|
||||
delete(publicationId: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user