mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-29 04:27:17 +00:00
Update looked its row up and ignored the result. When nothing matched - because the key does not exist, or because the caller's data scope filters the row out - the model stayed at its zero value, Generate copied the request onto it, and Save, finding a zero key, inserted a new row. The update of a row the caller may not see became a row they now own, and the RowsAffected check meant to refuse it never fired, because the insert did affect one. A missing row now ends the update with the same "无权更新该数据" the RowsAffected check returns, and any other lookup error is returned as is. This applies to every generated table, an int id included.