add entry media upload menu
This commit is contained in:
1 parent
4c318fb569
commit
c46309e458
14 files changed
+616
-2
No files matched your search
@@ -5,6 +5,7 @@ import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
import { Media } from '../../shared/models/media.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -41,6 +42,26 @@ export class EntryService {
|
||||
);
|
||||
}
|
||||
|
||||
addEntryMedia(entryId: number, data: FormData): Observable<Media> {
|
||||
return this.http.post<Media>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${entryId}/media`,
|
||||
data
|
||||
);
|
||||
}
|
||||
|
||||
selectEntryMedia(entryId: number, mediaId: number): Observable<Media> {
|
||||
return this.http.put<Media>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${entryId}/media/${mediaId}`,
|
||||
{}
|
||||
);
|
||||
}
|
||||
|
||||
deleteEntryMedia(entryId: number, mediaId: number): Observable<void> {
|
||||
return this.http.delete<void>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${entryId}/media/${mediaId}`
|
||||
);
|
||||
}
|
||||
|
||||
// update entry
|
||||
refrechEntryById(entryId: number) {
|
||||
return this.http.get<Entry>(
|
||||
|
||||
Reference in new issue
Block a user