Front: renamed most collection related files
This commit is contained in:
1 parent
75de013f82
commit
8724a96b81
55 files changed
+294
-394
No files matched your search
+17
-17
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { UserCollection } from '../../shared/models/userCollection.model';
|
||||
import { UserCollectionEntry } from '../../shared/models/userCollectionEntry.model';
|
||||
import { Collection } from '../../shared/models/collection.model';
|
||||
import { CollectionEntry } from '../../shared/models/collection-entry.model';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@@ -16,22 +16,22 @@ export class CollectionService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
// get all lists
|
||||
getCollections(): Observable<UserCollection[]> {
|
||||
return this.http.get<UserCollection[]>(
|
||||
getCollections(): Observable<Collection[]> {
|
||||
return this.http.get<Collection[]>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}`
|
||||
);
|
||||
}
|
||||
|
||||
// get a list by id
|
||||
getCollection(collectionId: string) {
|
||||
return this.http.get<UserCollection>(
|
||||
return this.http.get<Collection>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${collectionId}`
|
||||
);
|
||||
}
|
||||
|
||||
// Create a new list
|
||||
createCollection(collection: UserCollection): Observable<UserCollection> {
|
||||
return this.http.post<UserCollection>(
|
||||
createCollection(collection: Collection): Observable<Collection> {
|
||||
return this.http.post<Collection>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}`,
|
||||
collection
|
||||
);
|
||||
@@ -41,24 +41,24 @@ export class CollectionService {
|
||||
updateCollection(
|
||||
collectionId: number,
|
||||
formData: FormData
|
||||
): Observable<UserCollection> {
|
||||
return this.http.put<UserCollection>(
|
||||
): Observable<Collection> {
|
||||
return this.http.put<Collection>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${collectionId}`,
|
||||
formData
|
||||
);
|
||||
}
|
||||
|
||||
// * PUT - REFRESH COLLECTION
|
||||
refreshCollection(collectionId: number): Observable<UserCollection> {
|
||||
return this.http.put<UserCollection>(
|
||||
refreshCollection(collectionId: number): Observable<Collection> {
|
||||
return this.http.put<Collection>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${collectionId}/refresh`,
|
||||
{}
|
||||
);
|
||||
}
|
||||
|
||||
// * PUT - GET COLLECTION PARTS
|
||||
getCollectionParts(collectionId: number): Observable<UserCollection> {
|
||||
return this.http.put<UserCollection>(
|
||||
getCollectionParts(collectionId: number): Observable<Collection> {
|
||||
return this.http.put<Collection>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${collectionId}/parts`,
|
||||
{}
|
||||
);
|
||||
@@ -75,8 +75,8 @@ export class CollectionService {
|
||||
addEntryToCollection(
|
||||
collectionId: number,
|
||||
entryId: number
|
||||
): Observable<UserCollectionEntry> {
|
||||
return this.http.post<UserCollectionEntry>(
|
||||
): Observable<CollectionEntry> {
|
||||
return this.http.post<CollectionEntry>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${collectionId}/entries/${entryId}`,
|
||||
{}
|
||||
);
|
||||
@@ -84,7 +84,7 @@ export class CollectionService {
|
||||
|
||||
// Update an entry's order in a list
|
||||
updateEntryOrder(
|
||||
collectionId: string,
|
||||
collectionId: number,
|
||||
entryId: number,
|
||||
newOrder: number
|
||||
): Observable<any> {
|
||||
@@ -96,7 +96,7 @@ export class CollectionService {
|
||||
|
||||
// Remove an entry from a list
|
||||
removeEntryFromCollection(
|
||||
collectionId: string,
|
||||
collectionId: number,
|
||||
entryId: number
|
||||
): Observable<Entry> {
|
||||
return this.http.delete<Entry>(
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { EntryRating } from '../../shared/models/entry-rating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { EntrySeen } from '../../shared/models/entrySeen.model';
|
||||
import { EntrySeen } from '../../shared/models/entry-seen.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
|
||||
@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
|
||||
import { Observable, map } from 'rxjs';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { EntryRating } from '../../shared/models/entry-rating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
import { Media } from '../../shared/models/media.model';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { EpisodeSeen } from '../../shared/models/episodeSeen.model';
|
||||
import { EpisodeSeen } from '../../shared/models/episode-seen.model';
|
||||
import { EpisodeSeenDto } from '../../shared/models/dtos/episode-seen.dto';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MovieDateSeen } from '../../shared/models/dtos/movieDateSeen.model';
|
||||
import { MovieDateSeen } from '../../shared/models/dtos/movie-dateSeen.model';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Observable, ReplaySubject, throwError, map, of } from 'rxjs';
|
||||
import { catchError, switchMap, tap } from 'rxjs/operators';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { EntryRating } from '../../shared/models/entry-rating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
import { MaintenanceResult } from '../../shared/models/maintenanceResult.model';
|
||||
import { MaintenanceResult } from '../../shared/models/maintenance-result.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
|
||||
import { Observable, filter, from, map, of, switchMap, toArray } from 'rxjs';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { EntryRating } from '../../shared/models/entry-rating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
import { LibraryService } from './library.service';
|
||||
|
||||
|
||||
Reference in new issue
Block a user