Changeset e0cdea2 for Farmatiko


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

Fix all bugs

Location:
Farmatiko
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/src/app/admin/admin.component.ts

    r0a694bb re0cdea2  
    124124
    125125  rejectRequest(req: IPharmacyHeadRequest) {
    126     this.dataService.deleteClaimingRequest(req.id)
     126    this.dataService.deleteClaimingRequest(req)
    127127        .subscribe((status: boolean) => {
    128128          if(status) {
     
    139139  approveRequest(req: IPharmacyHeadRequest) {
    140140    if(req) {
     141      if (req.PharmacyHead.Pharmacy == null){
     142        req.PharmacyHead.Pharmacy = [];
     143      }
    141144    req.PharmacyHead.Pharmacy.push(req.Pharmacy);
    142145    this.dataService.updatePharmacyHead(req.PharmacyHead)
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts

    r0a694bb re0cdea2  
    9898  saveDeletedMedicines() {
    9999    this.dataService.updatePharmacyHead(this.head)
    100       .subscribe((hd: IPharmacyHead) => {
     100      .subscribe((hd) => {
    101101        if(hd) {
    102102          this.openSnackBar("Success! Medicine deleted", "OK");
  • Farmatiko/ClientApp/src/app/shared/data.service.ts

    r0a694bb re0cdea2  
    196196                    );
    197197    }
    198     deleteClaimingRequest(id: string) : Observable<boolean> {
    199         return this.http.post<boolean>(this.basePharmacyHead + '/requests/' + id, id)
     198    deleteClaimingRequest(req: IPharmacyHeadRequest) : Observable<boolean> {
     199        return this.http.post<boolean>(this.basePharmacyHead + '/requests/' + req.id, req)
    200200                    .pipe(
    201201                        map((data) => {
  • Farmatiko/Controllers/AdminController.cs

    r0a694bb re0cdea2  
    6161        [HttpPost]
    6262        [Route("api/pharmacyhead/requests/{Id}")]
    63         public IActionResult RejectRequest([FromRoute] int Id)
     63        public IActionResult RejectRequest([FromBody] RequestPharmacyHead req)
    6464        {
    65             bool Success = _adminService.RejectRequest(Id);
     65            bool Success = _adminService.RejectRequest(req);
    6666            return Ok(Success);
    6767        }
  • Farmatiko/Controllers/FarmatikoController.cs

    r0a694bb re0cdea2  
    8484        [HttpGet]
    8585        [Route("api/medicines/search/{query}")]
    86         public async Task<IEnumerable<Medicine>> SearchMedicines([FromRoute] string query)
     86        public async Task<IEnumerable<MedicineDTO>> SearchMedicines([FromRoute] string query)
    8787        {
    8888            return await _service.SearchMedicines(query);
     
    9797        [HttpGet]
    9898        [Route("api/pandemic")]
    99         public async Task<Pandemic> GetPandemic()
     99        public Pandemic GetPandemic()
    100100        {
    101             return await _service.GetPandemic();
     101            return _service.GetPandemic();
    102102        }
    103103        //Pharmacy
     
    111111        [HttpGet]
    112112        [Route("api/pharmacy/search/{Query}")]
    113         public async Task<IEnumerable<Pharmacy>> SearchPharmacies([FromRoute] string Query)
     113        public async Task<IEnumerable<PharmacyDTO>> SearchPharmacies([FromRoute] string Query)
    114114        {
    115115            return await _service.SearchPharmacies(Query);
  • Farmatiko/Farmatiko.csproj

    r0a694bb re0cdea2  
    5252  </ItemGroup>
    5353
     54  <ItemGroup>
     55    <Folder Include="ExcellDocs\" />
     56  </ItemGroup>
     57
    5458  <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
    5559    <!-- Ensure Node.js is installed -->
  • Farmatiko/Startup.cs

    r0a694bb re0cdea2  
    5454
    5555            services.AddScoped<IPHRepo, PHRepo>();
    56             services.AddTransient<IRepository, Repository>();
    57             services.AddTransient<IAdminRepo, AdminRepo>();
     56            services.AddScoped<IRepository, Repository>();
     57            services.AddScoped<IAdminRepo, AdminRepo>();
    5858
    59             services.AddTransient<IPHService, PHService>();
     59            services.AddScoped<IPHService, PHService>();
    6060            services.AddTransient<IAdminService, AdminService>();
    6161            services.AddTransient<IService, Service>();
Note: See TracChangeset for help on using the changeset viewer.