import { Body, Controller, Delete, Param } from '@nestjs/common';
import { FavRepo } from '../../repos/fav.repo';
import { Public } from '@/models/users/decorators/public-route';

@Controller('photos')
export class RemoveFavorite {
  constructor(private favRepo: FavRepo) {}

  @Public()
  @Delete(':id/:customerId/favorite')
  async execute(
    @Param('id') photoId: string,
    @Param('customerId') customerId: string,
  ) {
    await this.favRepo.removeFavorite(customerId, photoId);

    return {};
  }
}
