Styling publications on home page.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
export interface Author {
|
||||
id: string;
|
||||
name: string;
|
||||
image: string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Author } from "./author";
|
||||
|
||||
export interface Publication {
|
||||
id: string;
|
||||
key: string;
|
||||
title: string;
|
||||
text: string;
|
||||
parsedText: string;
|
||||
description: string;
|
||||
creationDate: Date;
|
||||
illustrationId: string;
|
||||
categoryId: string;
|
||||
author: Author;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { Publication } from './model/publication';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationRestService {
|
||||
private httpClient = inject(HttpClient);
|
||||
|
||||
getLatest(): Promise<Publication[]> {
|
||||
return lastValueFrom(this.httpClient.get<Publication[]>('/api/publications/latest'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user