upstream sync
This commit is contained in:
@@ -111,18 +111,27 @@ func GetContracts(status []string, companyName string, companyAddress string,
|
||||
return contracts, total, http.StatusOK, nil
|
||||
}
|
||||
|
||||
func UpdateContract(contract models.Contract) (models.Contract, int, error) {
|
||||
|
||||
// Update contract
|
||||
if err := shared.GetDb().Update(contract).Error; err != nil {
|
||||
log.Printf("UpdateContractByID Error: Could not update contract: %v", err)
|
||||
return contract, http.StatusInternalServerError, err
|
||||
}
|
||||
|
||||
return GetContractByID(uint64(contract.ID))
|
||||
|
||||
func GetContractByID(contractID uint64) (models.Contract, int ,error) {
|
||||
}
|
||||
|
||||
func GetContractByID(contractID uint64) (models.Contract, int, error) {
|
||||
|
||||
// Fetch the contract creation date based on contractID
|
||||
var contract models.Contract
|
||||
if err := shared.GetDb().Where("id = ?", contractID).First(&contract).Error; err != nil {
|
||||
log.Printf("GetDeviceData Error: Could not fetch contract: %v", err)
|
||||
log.Printf("GetContractByID Error: Could not fetch contract: %v", err)
|
||||
return contract, http.StatusInternalServerError, err
|
||||
}
|
||||
|
||||
return contract , http.StatusOK, nil
|
||||
|
||||
return contract, http.StatusOK, nil
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user