DEV Community

Faisal Ahmed
Faisal Ahmed

Posted on

1

Filter system

      <div class="from">
        <mat-label>Banner Type</mat-label>
        <mat-form-field appearance="outline" >
          <mat-select formControlName="type" required>
            <mat-option [value]="'home_banner'">Home Page Banner</mat-option>
            <mat-option [value]="'all'">Home Page Banner</mat-option>
          </mat-select>
          <mat-error>This field is required.</mat-error>
        </mat-form-field>
      </div>
Enter fullscreen mode Exit fullscreen mode
private getAllBanner() {
  // Select
  const mSelect = {
    image: 1,
    name: 1,
    status: 1,
    priority: 1,
    info: 1,
    createdAt: 1,
    description: 1,
  };

  const filter: FilterData = {
    filter: this.filter,
    // filter: { type: 'all', status: 'publish' },
    pagination: null,
    select: mSelect,
    sort: { createdAt: -1 },
  };

  this.subDataOne = this.bannerService.getAllBanners(filter, null).subscribe({
    next: (res) => {
      if (res.success) {
        this.banners = res.data;
        this.bannerCount = res.count;
        this.holdPrevData = this.banners;
        this.totalBannersStore = this.bannerCount;
      }
    },
    error: (err) => {
      console.log(err);
    },
  });
}
Enter fullscreen mode Exit fullscreen mode

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay