Browse Source

Delete/Id fromBody

zinab_elgendy 5 months ago
parent
commit
521ae06906

+ 1 - 1
MTWorkHR.API/Controllers/MeetingController.cs

@@ -54,7 +54,7 @@ namespace MTWorkHR.API.Controllers
         [HttpPost("Delete")]
         [ProducesResponseType(StatusCodes.Status200OK)]
 
-        public async Task Delete([FromQuery]long id)
+        public async Task Delete([FromBody]long id)
         {
             await _MeetingService.Delete(id);
         }

+ 2 - 2
MTWorkHR.API/Controllers/UserTaskController.cs

@@ -77,7 +77,7 @@ namespace MTWorkHR.API.Controllers
 
         [HttpPost("DeleteAttachment")]
         [ProducesResponseType(StatusCodes.Status200OK)]
-        public async Task DeleteAttachment([FromQuery] long id)
+        public async Task DeleteAttachment([FromBody] long id)
         {
             await _attachmentService.Delete(id);
         }
@@ -100,7 +100,7 @@ namespace MTWorkHR.API.Controllers
         }
         [HttpPost("DeleteTaskHistory")]
         [ProducesResponseType(StatusCodes.Status200OK)]
-        public async Task DeleteTaskHistory([FromQuery]long id)
+        public async Task DeleteTaskHistory([FromBody]long id)
         {
             await _taskHistoryService.Delete(id);
         }

+ 1 - 1
MTWorkHR.API/Program.cs

@@ -31,7 +31,7 @@ var config = new AppSettingsConfiguration();
 // Add services to the container.
 builder.Services.AddDbContext<HRDataContext>(options =>
 {
-    options.UseSqlServer(config.ConnectionStrings.LocalConnectionString);
+    options.UseSqlServer(config.ConnectionStrings.MTWorkHRConnectionString);
     //  options.UseSqlServer(builder.Configuration.GetSection("ConnectionStrings:MTWorkHRConnectionString").Value);
 });
 

+ 2 - 2
MTWorkHR.Application/ApplicationServiceRegistration.cs

@@ -22,8 +22,8 @@ namespace MTWorkHR.Application
 
             services.AddScoped<IAuthService, AuthService>();
             services.AddScoped<IUserService, UserService>();
-            services.AddTransient<IFileService, FileService>();
-          //  services.AddScoped<IFileService, BlobFileService>();
+          //  services.AddTransient<IFileService, FileService>();
+            services.AddScoped<IFileService, BlobFileService>();
             services.AddScoped<IProjectService, ProjectService>();
             services.AddScoped<IUserTaskService, UserTaskService>();
             services.AddScoped<IUserTaskAttachmentService, UserTaskAttachmentService>();

+ 1 - 1
MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs

@@ -31,7 +31,7 @@ namespace MTWorkHR.Infrastructure
             
             services.AddDbContext<HRDataContext>(options =>
                 options.UseSqlServer(
-                    config.ConnectionStrings.LocalConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
+                    config.ConnectionStrings.MTWorkHRConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
                     ));
            
             services.AddIdentity<ApplicationUser, ApplicationRole>().AddEntityFrameworkStores<HRDataContext>().AddDefaultTokenProviders();