unit, unit-position,installation-position removes ids
This commit is contained in:
@@ -175,7 +175,7 @@ func ReadDetail(input e.ReadDetailDto) (*d.Data, error) {
|
||||
}
|
||||
|
||||
func Update(input e.UpdateDto) (*d.Data, error) {
|
||||
rdDto := e.ReadDetailDto{Id: input.Id}
|
||||
rdDto := e.ReadDetailDto{Code: &input.Code}
|
||||
var data *e.UnitPosition
|
||||
var err error
|
||||
|
||||
@@ -235,7 +235,7 @@ func Update(input e.UpdateDto) (*d.Data, error) {
|
||||
}
|
||||
|
||||
func Delete(input e.DeleteDto) (*d.Data, error) {
|
||||
rdDto := e.ReadDetailDto{Id: input.Id}
|
||||
rdDto := e.ReadDetailDto{Code: input.Code}
|
||||
var data *e.UnitPosition
|
||||
var err error
|
||||
|
||||
@@ -290,7 +290,7 @@ func Delete(input e.DeleteDto) (*d.Data, error) {
|
||||
|
||||
func validateForeignKey(input e.CreateDto) error {
|
||||
// validate installation_id
|
||||
if _, err := uu.ReadDetail(eu.ReadDetailDto{Id: *input.Unit_Id}); err != nil {
|
||||
if _, err := uu.ReadDetail(eu.ReadDetailDto{Code: &input.Code}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user