fix: getBillById 0 id error
This commit is contained in:
parent
c777315687
commit
940b641500
|
@ -49,7 +49,7 @@ func (db *sqliteRepository) GetBillByYear(ctx context.Context, year int) ([]Bill
|
|||
|
||||
func (db *sqliteRepository) GetBillByID(ctx context.Context, id int) (*Bill, error) {
|
||||
var bill Bill
|
||||
if err := db.Where("id =?", id).Find(&bill).Error; err != nil {
|
||||
if err := db.Where("id =?", id).First(&bill).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &bill, nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user