From 6a5defe9d6ec29ae35c0c7ae6a6fa3754a405312 Mon Sep 17 00:00:00 2001 From: johnnyjoy Date: Wed, 18 Sep 2024 20:07:53 +0800 Subject: [PATCH] chore: update common utils --- store/common.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/store/common.go b/store/common.go index 9c451f1..e527e34 100644 --- a/store/common.go +++ b/store/common.go @@ -5,21 +5,17 @@ import ( ) func ConvertRowStatusStringToStorepb(status string) storepb.RowStatus { - switch status { - case "NORMAL": + if status == "NORMAL" { return storepb.RowStatus_NORMAL - case "ARCHIVED": - return storepb.RowStatus_ARCHIVED } - return storepb.RowStatus_ROW_STATUS_UNSPECIFIED + // Otherwise, fallback to archived status. + return storepb.RowStatus_ARCHIVED } func ConvertVisibilityStringToStorepb(visibility string) storepb.Visibility { - switch visibility { - case "PRIVATE", "WORKSPACE": - return storepb.Visibility_WORKSPACE - case "PUBLIC": + if visibility == "PUBLIC" { return storepb.Visibility_PUBLIC } - return storepb.Visibility_VISIBILITY_UNSPECIFIED + // Otherwise, fallback to workspace visibility. + return storepb.Visibility_WORKSPACE }