A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix(config): use key to update a specific item
[email protected]aa972354a8f9
diff --git a/internal/repo/config/config_repo.go b/internal/repo/config/config_repo.goindex c5a155bd..0673b699 100644--- a/internal/repo/config/config_repo.go+++ b/internal/repo/config/config_repo.go@@ -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()