Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Dec 30, 2020
1 parent dfc2a1f commit 3926087
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { NoctuaReviewSearchService } from './../../services/noctua-review-search
import { NoctuaConfirmDialogService } from '@noctua/components/confirm-dialog/confirm-dialog.service';
import { LeftPanel, MiddlePanel } from './../../models/menu-panels';
import { NoctuaSearchDialogService } from './../../services/dialog.service';
import { SearchCriteria } from '@noctua.search/models/search-criteria';

@Component({
selector: 'noc-art-basket',
Expand Down Expand Up @@ -83,6 +84,13 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
this.noctuaReviewSearchService.removeFromArtBasket(cam.id);
}

getStoredCam(cam: Cam) {
const searchCriteria = new SearchCriteria();

searchCriteria.ids = [cam.id];
this.noctuaReviewSearchService.getStoredModel(searchCriteria);
}

clear() {

const success = (cancel) => {
Expand Down
17 changes: 17 additions & 0 deletions src/@noctua.search/services/noctua-review-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,23 @@ export class NoctuaReviewSearchService {
);
}

getStoredModel(searchCriteria: SearchCriteria): Observable<any> {
const self = this;
this.searchCriteria.expand = false;
const query = searchCriteria.build();
const url = `${this.searchApi}/stored?${query}`;

self.loading = true;

return this.httpClient
.get(url)
.pipe(
//map(res => this.addCam(res)),
finalize(() => {
self.loading = false;
})
);
}

addCam(res) {
const self = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ArtBasket } from '@noctua.search/models/art-basket';
import { LeftPanel, MiddlePanel, RightPanel } from '@noctua.search/models/menu-panels';
import { NoctuaSearchMenuService } from '@noctua.search/services/search-menu.service';
import { ReviewMode } from '@noctua.search/models/review-mode';
import { SearchCriteria } from '@noctua.search/models/search-criteria';

@Component({
selector: 'noc-cams-review',
Expand Down Expand Up @@ -110,6 +111,13 @@ export class CamsReviewComponent implements OnInit, OnDestroy {
this.camService.loadCam(cam);
}

getStoredCam(cam: Cam) {
const searchCriteria = new SearchCriteria();

searchCriteria.ids = [cam.id];
this.noctuaReviewSearchService.getStoredModel(searchCriteria);
}

selectMiddlePanel(panel) {
this.noctuaSearchMenuService.selectMiddlePanel(panel);

Expand Down

0 comments on commit 3926087

Please sign in to comment.