feat/user: reworking auth

This commit is contained in:
2025-10-19 15:10:14 +07:00
parent 721a7e0467
commit 19e5ddf65d
5 changed files with 53 additions and 33 deletions

No files matched your search

+2 -2
View File
@@ -83,7 +83,7 @@ func Create(input e.CreateDto) (*d.Data, error) {
data = *resData
}
if input.ContractPosition_Code == ero.CSCSpi {
if input.ContractPosition_Code == ero.CSCInt {
createInt := esi.CreateDto{
Person_Id: input.Person_Id,
Specialist_Id: input.Specialist_Id,
@@ -336,7 +336,7 @@ func Update(input e.UpdateDto) (*d.Data, error) {
return err
}
if input.ContractPosition_Code == ero.CSCSpi {
if input.ContractPosition_Code == ero.CSCInt {
readInt := esi.ReadDetailDto{User_Id: &data.Id}
readIntData, err := usi.ReadDetailData(readInt, &event, tx)
if err != nil {
@@ -56,7 +56,7 @@ func setDataEmployeeUpdate(src e.EmployeUpdateDto) ee.UpdateDto {
func getPersonIdByUserId(userId uint, positionCode erg.ContractPositionCode, event *pl.Event, tx *gorm.DB) (*uint, error) {
pl.SetLogInfo(event, nil, "started", "DBGetPersonIdByUserId")
if positionCode == erg.CSCEmp {
} else if positionCode == erg.CSCSpi {
} else if positionCode == erg.CSCInt {
specInt, err := usi.ReadDetailData(esi.ReadDetailDto{User_Id: &userId}, event, tx)
if err != nil {
return nil, err