Implemented users update button in frontend

This commit is contained in:
2025-10-25 22:15:08 +02:00
parent dcb23b76ec
commit 310e05545f
6 changed files with 458 additions and 76 deletions

View File

@@ -1,4 +1,5 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Berufsschule_HAM.Models;
@@ -26,17 +27,24 @@ public class UserModel
public class UserDescription
{
[JsonPropertyName("BirthDate")]
public required string BirthDate { get; set; }
[JsonPropertyName("Address")]
public required UserAddress Address { get; set; }
[JsonPropertyName("Workplace")]
public required string Workplace { get; set; }
[JsonPropertyName("Groups")]
public List<string>? Groups { get; set; }
}
public class UserAddress
{
[JsonPropertyName("City")]
public string? City { get; set; }
[JsonPropertyName("Street")]
public string? Street { get; set; }
public string? StreetNr { get; set; }
[JsonPropertyName("StreetNr")]
public int? StreetNr { get; set; }
}
public class UserAuthenticationResult
@@ -61,5 +69,5 @@ public class UserTableViewModel
public required string Title { get; set; }
public required string Name { get; set; }
public required string Surname { get; set; }
public required string Workplace { get; set; }
public required UserDescription Description { get; set; }
}

View File

@@ -1,3 +1,5 @@
using System.Text.Json.Serialization;
namespace Berufsschule_HAM.Models;
public class UsersIndexRequestModel
@@ -13,13 +15,21 @@ public class UsersIndexRequestModel
public class UsersModifyRequestModel
{
public required string uid { get; set; }
[JsonPropertyName("Uid")]
public required string Uid { get; set; }
[JsonPropertyName("NewUid")]
public string? NewUid { get; set; } = null;
[JsonPropertyName("Cn")]
public string? Cn { get; set; } = null;
[JsonPropertyName("Sn")]
public string? Sn { get; set; } = null;
[JsonPropertyName("Title")]
public string? Title { get; set; } = null;
public string? Description { get; set; } = null;
[JsonPropertyName("Description")]
public UserDescription? Description { get; set; } = null;
[JsonPropertyName("JpegPhoto")]
public string? JpegPhoto { get; set; } = null;
[JsonPropertyName("UserPassword")]
public string? UserPassword { get; set; } = null;
}

View File

@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace Berufsschule_HAM.Models;
public class UsersUpdateRequestModel
{
[JsonPropertyName("Success")]
public required bool Success { get; set; }
[JsonPropertyName("Exception")]
public string? Exception { get; set; }
[JsonPropertyName("NewUid")]
public string? NewUid { get; set; }
}