mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: tweak resource state in api
This commit is contained in:
@ -15,22 +15,22 @@ const (
|
||||
DefaultPageSize = 10
|
||||
)
|
||||
|
||||
func convertRowStatusFromStore(rowStatus store.RowStatus) v1pb.RowStatus {
|
||||
func convertStateFromStore(rowStatus store.RowStatus) v1pb.State {
|
||||
switch rowStatus {
|
||||
case store.Normal:
|
||||
return v1pb.RowStatus_ACTIVE
|
||||
return v1pb.State_NORMAL
|
||||
case store.Archived:
|
||||
return v1pb.RowStatus_ARCHIVED
|
||||
return v1pb.State_ARCHIVED
|
||||
default:
|
||||
return v1pb.RowStatus_ROW_STATUS_UNSPECIFIED
|
||||
return v1pb.State_STATE_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func convertRowStatusToStore(rowStatus v1pb.RowStatus) store.RowStatus {
|
||||
switch rowStatus {
|
||||
case v1pb.RowStatus_ACTIVE:
|
||||
func convertStateToStore(state v1pb.State) store.RowStatus {
|
||||
switch state {
|
||||
case v1pb.State_NORMAL:
|
||||
return store.Normal
|
||||
case v1pb.RowStatus_ARCHIVED:
|
||||
case v1pb.State_ARCHIVED:
|
||||
return store.Archived
|
||||
default:
|
||||
return store.Normal
|
||||
|
Reference in New Issue
Block a user