public async Task RejectImage(ImageAprovedDTO item)
        {
            var rest = await _restaurantDal.GetAsync(x => x.Id == new ObjectId(item.RestId));

            if (rest == null)
            {
                throw new HttpStatusCodeException(StatusCodes.Status404NotFound, "Restaurant Bulunumadı..!!");
            }

            var prod = rest.Images.FirstOrDefault(x => x.Id == new ObjectId(item.ImageId));

            if (prod == null)
            {
                throw new HttpStatusCodeException(StatusCodes.Status404NotFound, "Resim Bulunumadı..!!");
            }

            prod.Statu = StatusType.Reject;

            await UpdateAsync(rest);
        }
        public async Task ApprovedImageAsync(ImageAprovedDTO item)
        {
            var rest = await _restaurantDal.GetAsync(x => x.Id == new MongoDB.Bson.ObjectId((string)item.RestId));

            if (rest == null)
            {
                throw new HttpStatusCodeException(StatusCodes.Status404NotFound, "Ödül Bulunumadı..!!");
            }


            var image = rest.Images.FirstOrDefault(x => x.Id == new ObjectId((string)item.ImageId));

            if (image == null)
            {
                throw new HttpStatusCodeException(StatusCodes.Status404NotFound, "Ödül Bulunumadı..!!");
            }


            image.Statu = StatusType.Approved;

            await UpdateAsync(rest);
        }
Exemple #3
0
 public async Task RejectImage([FromBody] ImageAprovedDTO item)
 {
     await _restaurantService.RejectImage(item);
 }
Exemple #4
0
 public async Task ApprovedImageAsync([FromBody] ImageAprovedDTO item)
 {
     await _restaurantService.ApprovedImageAsync(item);
 }