Ignore:
Timestamp:
02/08/21 16:39:25 (2 years ago)
Author:
Dimitar Slezenkovski <dslezenkovski@…>
Branches:
master
Children:
8eb1e21, dae4cde
Parents:
0a694bb
Message:

Fix all bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • FarmatikoData/FarmatikoRepo/AdminRepo.cs

    r0a694bb re0cdea2  
    2020        public async Task<IEnumerable<RequestPharmacyHead>> GetClaimingRequests()
    2121        {
    22             var reqs = await _context.PHRequests.OrderBy(x => x.Head.Name).ToListAsync();
     22            var reqs = await _context.PHRequests.Select(x => new RequestPharmacyHead
     23            {
     24                Head = x.Head,
     25                Pharmacy = x.Pharmacy
     26            }).OrderBy(x => x.Head.Name).ToListAsync();
    2327            return reqs;
    2428        }
     
    3539        }
    3640        //POST
    37         public async void RemoveClaimRequest(int Id)
     41        public void RemoveClaimRequest(RequestPharmacyHead request)
    3842        {
    39             var req = _context.PHRequests.Where(x => x.Id == Id).FirstOrDefault();
     43            var req = _context.PHRequests.Select(x => new RequestPharmacyHead { Head = x.Head, Pharmacy = x.Pharmacy, Id = x.Id})
     44                .Where(x => x.Head.Email.Equals(request.Head.Email)).FirstOrDefault();
    4045            _context.PHRequests.Remove(req);
    41             await _context.SaveChangesAsync();
     46            _context.SaveChanges();
    4247        }
    4348    }
Note: See TracChangeset for help on using the changeset viewer.