Merge pull request #412 from nonvis/fix/update-config-repo

fix(config): Use key to update config repo
This commit is contained in:
LinkinStars 2023-06-22 21:23:47 +08:00 committed by GitHub
commit 765ae6e105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ func (cr configRepo) GetConfigByKey(ctx context.Context, key string) (c *entity.
func (cr configRepo) UpdateConfig(ctx context.Context, key string, value string) (err error) {
// check if key exists
oldConfig := &entity.Config{}
oldConfig := &entity.Config{Key: key}
exist, err := cr.data.DB.Context(ctx).Get(oldConfig)
if err != nil {
return errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()