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); }
public async Task RejectImage([FromBody] ImageAprovedDTO item) { await _restaurantService.RejectImage(item); }
public async Task ApprovedImageAsync([FromBody] ImageAprovedDTO item) { await _restaurantService.ApprovedImageAsync(item); }