Last active
July 11, 2024 11:27
-
-
Save BK1031/280fd611b303289d7edfdf5d72fce3a7 to your computer and use it in GitHub Desktop.
racecar_analytics add push to create functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func CreateECU(ecu ECU) (ECU, error) { | |
result := DB.Create(&ecu) | |
if result.Error != nil { | |
return ECU{}, result.Error | |
} | |
PushECU(ecu) // add this | |
return ecu, nil | |
} | |
func CreateBattery(battery Battery) (Battery, error) { | |
result := DB.Create(&battery) | |
if result.Error != nil { | |
return Battery{}, result.Error | |
} | |
PushBattery(battery) // add this | |
return battery, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment