Explorar o código

userData for get by id

zinab_elgendy hai 2 meses
pai
achega
3c1a2e915b

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

@@ -37,7 +37,7 @@ namespace MTWorkHR.API.Controllers
             return Ok(await _userService.GetById());
         }
         [HttpGet("GetById")]
-        public async Task<ActionResult<UserDto>> GetById(string userId)
+        public async Task<ActionResult<UserDto>> GetById([FromQuery] string userId)
         {
             return Ok(await _userService.GetById(userId));
         }

+ 2 - 1
MTWorkHR.Application/Services/User/UserService.cs

@@ -88,10 +88,11 @@ namespace MTWorkHR.Application.Services
 
                     using (var stream = new MemoryStream(attach.Content))
                     {
-                        var file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FileName)
+                        var file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FilePath)
                         {
                             Headers = new HeaderDictionary(),
                             ContentType = attach.ContentType,
+                            
                         };
 
                         System.Net.Mime.ContentDisposition cd = new System.Net.Mime.ContentDisposition

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5752 - 0
MTWorkHR.Infrastructure/Migrations/20241226130909_altrCompanyPostal.Designer.cs


+ 28 - 0
MTWorkHR.Infrastructure/Migrations/20241226130909_altrCompanyPostal.cs

@@ -0,0 +1,28 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrCompanyPostal : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<string>(
+                name: "PostalCode",
+                table: "Companies",
+                type: "nvarchar(max)",
+                nullable: true);
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "PostalCode",
+                table: "Companies");
+        }
+    }
+}

+ 3 - 0
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

@@ -514,6 +514,9 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .IsRequired()
                         .HasColumnType("nvarchar(max)");
 
+                    b.Property<string>("PostalCode")
+                        .HasColumnType("nvarchar(max)");
+
                     b.Property<int>("TaxNumber")
                         .HasColumnType("int");