diff --git a/frontend/web/src/stores/user.ts b/frontend/web/src/stores/user.ts index 84edce4..620b369 100644 --- a/frontend/web/src/stores/user.ts +++ b/frontend/web/src/stores/user.ts @@ -101,11 +101,9 @@ const useUserStore = create()((set, get) => ({ }); }, fetchUserSetting: async (userId: number) => { - const userSetting = ( - await userSettingServiceClient.getUserSetting({ - id: userId, - }) - ).userSetting as UserSetting; + const userSetting = await userSettingServiceClient.getUserSetting({ + id: userId, + }); const userSettingMap = get().userSettingMapById; userSettingMap[userId] = userSetting; set(userSettingMap); @@ -113,13 +111,11 @@ const useUserStore = create()((set, get) => ({ }, updateUserSetting: async (userSetting: UserSetting, updateMask: string[]) => { const userId = userSetting.userId; - const updatedUserSetting = ( - await userSettingServiceClient.updateUserSetting({ - id: userId, - userSetting, - updateMask, - }) - ).userSetting as UserSetting; + const updatedUserSetting = await userSettingServiceClient.updateUserSetting({ + id: userId, + userSetting, + updateMask, + }); const userSettingMap = get().userSettingMapById; userSettingMap[userId] = updatedUserSetting; set(userSettingMap); diff --git a/proto/api/v1/user_setting_service.proto b/proto/api/v1/user_setting_service.proto index b8da5b4..7465f67 100644 --- a/proto/api/v1/user_setting_service.proto +++ b/proto/api/v1/user_setting_service.proto @@ -10,12 +10,12 @@ option go_package = "gen/api/v1"; service UserSettingService { // GetUserSetting returns the user setting. - rpc GetUserSetting(GetUserSettingRequest) returns (GetUserSettingResponse) { + rpc GetUserSetting(GetUserSettingRequest) returns (UserSetting) { option (google.api.http) = {get: "/api/v1/users/{id}/settings"}; option (google.api.method_signature) = "id"; } // UpdateUserSetting updates the user setting. - rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) { + rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UserSetting) { option (google.api.http) = { patch: "/api/v1/users/{id}/settings" body: "user_setting" @@ -52,10 +52,6 @@ message GetUserSettingRequest { int32 id = 1; } -message GetUserSettingResponse { - UserSetting user_setting = 1; -} - message UpdateUserSettingRequest { // id is the user id. int32 id = 1; @@ -66,7 +62,3 @@ message UpdateUserSettingRequest { // update_mask is the field mask to update. google.protobuf.FieldMask update_mask = 3; } - -message UpdateUserSettingResponse { - UserSetting user_setting = 1; -} diff --git a/proto/gen/api/v1/README.md b/proto/gen/api/v1/README.md index 0bd8d03..cbe5001 100644 --- a/proto/gen/api/v1/README.md +++ b/proto/gen/api/v1/README.md @@ -79,9 +79,7 @@ - [api/v1/user_setting_service.proto](#api_v1_user_setting_service-proto) - [GetUserSettingRequest](#slash-api-v1-GetUserSettingRequest) - - [GetUserSettingResponse](#slash-api-v1-GetUserSettingResponse) - [UpdateUserSettingRequest](#slash-api-v1-UpdateUserSettingRequest) - - [UpdateUserSettingResponse](#slash-api-v1-UpdateUserSettingResponse) - [UserSetting](#slash-api-v1-UserSetting) - [UserSetting.AccessTokensSetting](#slash-api-v1-UserSetting-AccessTokensSetting) - [UserSetting.AccessTokensSetting.AccessToken](#slash-api-v1-UserSetting-AccessTokensSetting-AccessToken) @@ -1056,21 +1054,6 @@ - - -### GetUserSettingResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| user_setting | [UserSetting](#slash-api-v1-UserSetting) | | | - - - - - - ### UpdateUserSettingRequest @@ -1088,21 +1071,6 @@ - - -### UpdateUserSettingResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| user_setting | [UserSetting](#slash-api-v1-UserSetting) | | | - - - - - - ### UserSetting @@ -1180,8 +1148,8 @@ | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| -| GetUserSetting | [GetUserSettingRequest](#slash-api-v1-GetUserSettingRequest) | [GetUserSettingResponse](#slash-api-v1-GetUserSettingResponse) | GetUserSetting returns the user setting. | -| UpdateUserSetting | [UpdateUserSettingRequest](#slash-api-v1-UpdateUserSettingRequest) | [UpdateUserSettingResponse](#slash-api-v1-UpdateUserSettingResponse) | UpdateUserSetting updates the user setting. | +| GetUserSetting | [GetUserSettingRequest](#slash-api-v1-GetUserSettingRequest) | [UserSetting](#slash-api-v1-UserSetting) | GetUserSetting returns the user setting. | +| UpdateUserSetting | [UpdateUserSettingRequest](#slash-api-v1-UpdateUserSettingRequest) | [UserSetting](#slash-api-v1-UserSetting) | UpdateUserSetting updates the user setting. | diff --git a/proto/gen/api/v1/user_setting_service.pb.go b/proto/gen/api/v1/user_setting_service.pb.go index 24d43f1..758ad8f 100644 --- a/proto/gen/api/v1/user_setting_service.pb.go +++ b/proto/gen/api/v1/user_setting_service.pb.go @@ -133,53 +133,6 @@ func (x *GetUserSettingRequest) GetId() int32 { return 0 } -type GetUserSettingResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserSetting *UserSetting `protobuf:"bytes,1,opt,name=user_setting,json=userSetting,proto3" json:"user_setting,omitempty"` -} - -func (x *GetUserSettingResponse) Reset() { - *x = GetUserSettingResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_api_v1_user_setting_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserSettingResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserSettingResponse) ProtoMessage() {} - -func (x *GetUserSettingResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_user_setting_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserSettingResponse.ProtoReflect.Descriptor instead. -func (*GetUserSettingResponse) Descriptor() ([]byte, []int) { - return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{2} -} - -func (x *GetUserSettingResponse) GetUserSetting() *UserSetting { - if x != nil { - return x.UserSetting - } - return nil -} - type UpdateUserSettingRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -196,7 +149,7 @@ type UpdateUserSettingRequest struct { func (x *UpdateUserSettingRequest) Reset() { *x = UpdateUserSettingRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_user_setting_service_proto_msgTypes[3] + mi := &file_api_v1_user_setting_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -209,7 +162,7 @@ func (x *UpdateUserSettingRequest) String() string { func (*UpdateUserSettingRequest) ProtoMessage() {} func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_user_setting_service_proto_msgTypes[3] + mi := &file_api_v1_user_setting_service_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -222,7 +175,7 @@ func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserSettingRequest.ProtoReflect.Descriptor instead. func (*UpdateUserSettingRequest) Descriptor() ([]byte, []int) { - return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{3} + return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{2} } func (x *UpdateUserSettingRequest) GetId() int32 { @@ -246,53 +199,6 @@ func (x *UpdateUserSettingRequest) GetUpdateMask() *fieldmaskpb.FieldMask { return nil } -type UpdateUserSettingResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserSetting *UserSetting `protobuf:"bytes,1,opt,name=user_setting,json=userSetting,proto3" json:"user_setting,omitempty"` -} - -func (x *UpdateUserSettingResponse) Reset() { - *x = UpdateUserSettingResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_api_v1_user_setting_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserSettingResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserSettingResponse) ProtoMessage() {} - -func (x *UpdateUserSettingResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_user_setting_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserSettingResponse.ProtoReflect.Descriptor instead. -func (*UpdateUserSettingResponse) Descriptor() ([]byte, []int) { - return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{4} -} - -func (x *UpdateUserSettingResponse) GetUserSetting() *UserSetting { - if x != nil { - return x.UserSetting - } - return nil -} - type UserSetting_GeneralSetting struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -305,7 +211,7 @@ type UserSetting_GeneralSetting struct { func (x *UserSetting_GeneralSetting) Reset() { *x = UserSetting_GeneralSetting{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_user_setting_service_proto_msgTypes[5] + mi := &file_api_v1_user_setting_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -318,7 +224,7 @@ func (x *UserSetting_GeneralSetting) String() string { func (*UserSetting_GeneralSetting) ProtoMessage() {} func (x *UserSetting_GeneralSetting) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_user_setting_service_proto_msgTypes[5] + mi := &file_api_v1_user_setting_service_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -359,7 +265,7 @@ type UserSetting_AccessTokensSetting struct { func (x *UserSetting_AccessTokensSetting) Reset() { *x = UserSetting_AccessTokensSetting{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_user_setting_service_proto_msgTypes[6] + mi := &file_api_v1_user_setting_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -372,7 +278,7 @@ func (x *UserSetting_AccessTokensSetting) String() string { func (*UserSetting_AccessTokensSetting) ProtoMessage() {} func (x *UserSetting_AccessTokensSetting) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_user_setting_service_proto_msgTypes[6] + mi := &file_api_v1_user_setting_service_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -409,7 +315,7 @@ type UserSetting_AccessTokensSetting_AccessToken struct { func (x *UserSetting_AccessTokensSetting_AccessToken) Reset() { *x = UserSetting_AccessTokensSetting_AccessToken{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_user_setting_service_proto_msgTypes[7] + mi := &file_api_v1_user_setting_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -422,7 +328,7 @@ func (x *UserSetting_AccessTokensSetting_AccessToken) String() string { func (*UserSetting_AccessTokensSetting_AccessToken) ProtoMessage() {} func (x *UserSetting_AccessTokensSetting_AccessToken) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_user_setting_service_proto_msgTypes[7] + mi := &file_api_v1_user_setting_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -495,62 +401,49 @@ var file_api_v1_user_setting_service_proto_rawDesc = []byte{ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x56, 0x0a, 0x16, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x22, 0xa5, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, - 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x59, 0x0a, 0x19, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0xa5, 0x01, 0x0a, 0x18, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xd1, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, 0x01, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, - 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0xda, 0x41, - 0x18, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, - 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0x1b, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xb5, 0x01, 0x0a, 0x10, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, - 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, - 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, - 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, - 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, - 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, + 0x61, 0x73, 0x6b, 0x32, 0xb7, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7a, 0x0a, 0x0e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x28, 0xda, 0x41, + 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xa4, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, + 0x4c, 0xda, 0x41, 0x18, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2b, 0x3a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x32, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xb5, 0x01, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, + 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, + 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, + 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -565,35 +458,31 @@ func file_api_v1_user_setting_service_proto_rawDescGZIP() []byte { return file_api_v1_user_setting_service_proto_rawDescData } -var file_api_v1_user_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_api_v1_user_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_api_v1_user_setting_service_proto_goTypes = []any{ (*UserSetting)(nil), // 0: slash.api.v1.UserSetting (*GetUserSettingRequest)(nil), // 1: slash.api.v1.GetUserSettingRequest - (*GetUserSettingResponse)(nil), // 2: slash.api.v1.GetUserSettingResponse - (*UpdateUserSettingRequest)(nil), // 3: slash.api.v1.UpdateUserSettingRequest - (*UpdateUserSettingResponse)(nil), // 4: slash.api.v1.UpdateUserSettingResponse - (*UserSetting_GeneralSetting)(nil), // 5: slash.api.v1.UserSetting.GeneralSetting - (*UserSetting_AccessTokensSetting)(nil), // 6: slash.api.v1.UserSetting.AccessTokensSetting - (*UserSetting_AccessTokensSetting_AccessToken)(nil), // 7: slash.api.v1.UserSetting.AccessTokensSetting.AccessToken - (*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask + (*UpdateUserSettingRequest)(nil), // 2: slash.api.v1.UpdateUserSettingRequest + (*UserSetting_GeneralSetting)(nil), // 3: slash.api.v1.UserSetting.GeneralSetting + (*UserSetting_AccessTokensSetting)(nil), // 4: slash.api.v1.UserSetting.AccessTokensSetting + (*UserSetting_AccessTokensSetting_AccessToken)(nil), // 5: slash.api.v1.UserSetting.AccessTokensSetting.AccessToken + (*fieldmaskpb.FieldMask)(nil), // 6: google.protobuf.FieldMask } var file_api_v1_user_setting_service_proto_depIdxs = []int32{ - 5, // 0: slash.api.v1.UserSetting.general:type_name -> slash.api.v1.UserSetting.GeneralSetting - 6, // 1: slash.api.v1.UserSetting.access_tokens:type_name -> slash.api.v1.UserSetting.AccessTokensSetting - 0, // 2: slash.api.v1.GetUserSettingResponse.user_setting:type_name -> slash.api.v1.UserSetting - 0, // 3: slash.api.v1.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v1.UserSetting - 8, // 4: slash.api.v1.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask - 0, // 5: slash.api.v1.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v1.UserSetting - 7, // 6: slash.api.v1.UserSetting.AccessTokensSetting.access_tokens:type_name -> slash.api.v1.UserSetting.AccessTokensSetting.AccessToken - 1, // 7: slash.api.v1.UserSettingService.GetUserSetting:input_type -> slash.api.v1.GetUserSettingRequest - 3, // 8: slash.api.v1.UserSettingService.UpdateUserSetting:input_type -> slash.api.v1.UpdateUserSettingRequest - 2, // 9: slash.api.v1.UserSettingService.GetUserSetting:output_type -> slash.api.v1.GetUserSettingResponse - 4, // 10: slash.api.v1.UserSettingService.UpdateUserSetting:output_type -> slash.api.v1.UpdateUserSettingResponse - 9, // [9:11] is the sub-list for method output_type - 7, // [7:9] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 3, // 0: slash.api.v1.UserSetting.general:type_name -> slash.api.v1.UserSetting.GeneralSetting + 4, // 1: slash.api.v1.UserSetting.access_tokens:type_name -> slash.api.v1.UserSetting.AccessTokensSetting + 0, // 2: slash.api.v1.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v1.UserSetting + 6, // 3: slash.api.v1.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask + 5, // 4: slash.api.v1.UserSetting.AccessTokensSetting.access_tokens:type_name -> slash.api.v1.UserSetting.AccessTokensSetting.AccessToken + 1, // 5: slash.api.v1.UserSettingService.GetUserSetting:input_type -> slash.api.v1.GetUserSettingRequest + 2, // 6: slash.api.v1.UserSettingService.UpdateUserSetting:input_type -> slash.api.v1.UpdateUserSettingRequest + 0, // 7: slash.api.v1.UserSettingService.GetUserSetting:output_type -> slash.api.v1.UserSetting + 0, // 8: slash.api.v1.UserSettingService.UpdateUserSetting:output_type -> slash.api.v1.UserSetting + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_api_v1_user_setting_service_proto_init() } @@ -627,18 +516,6 @@ func file_api_v1_user_setting_service_proto_init() { } } file_api_v1_user_setting_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetUserSettingResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_v1_user_setting_service_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*UpdateUserSettingRequest); i { case 0: return &v.state @@ -650,19 +527,7 @@ func file_api_v1_user_setting_service_proto_init() { return nil } } - file_api_v1_user_setting_service_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*UpdateUserSettingResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_v1_user_setting_service_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_api_v1_user_setting_service_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*UserSetting_GeneralSetting); i { case 0: return &v.state @@ -674,7 +539,7 @@ func file_api_v1_user_setting_service_proto_init() { return nil } } - file_api_v1_user_setting_service_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_api_v1_user_setting_service_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*UserSetting_AccessTokensSetting); i { case 0: return &v.state @@ -686,7 +551,7 @@ func file_api_v1_user_setting_service_proto_init() { return nil } } - file_api_v1_user_setting_service_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_api_v1_user_setting_service_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*UserSetting_AccessTokensSetting_AccessToken); i { case 0: return &v.state @@ -705,7 +570,7 @@ func file_api_v1_user_setting_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v1_user_setting_service_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/api/v1/user_setting_service_grpc.pb.go b/proto/gen/api/v1/user_setting_service_grpc.pb.go index 90fee7a..2348817 100644 --- a/proto/gen/api/v1/user_setting_service_grpc.pb.go +++ b/proto/gen/api/v1/user_setting_service_grpc.pb.go @@ -28,9 +28,9 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type UserSettingServiceClient interface { // GetUserSetting returns the user setting. - GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*GetUserSettingResponse, error) + GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) // UpdateUserSetting updates the user setting. - UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UpdateUserSettingResponse, error) + UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) } type userSettingServiceClient struct { @@ -41,9 +41,9 @@ func NewUserSettingServiceClient(cc grpc.ClientConnInterface) UserSettingService return &userSettingServiceClient{cc} } -func (c *userSettingServiceClient) GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*GetUserSettingResponse, error) { +func (c *userSettingServiceClient) GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetUserSettingResponse) + out := new(UserSetting) err := c.cc.Invoke(ctx, UserSettingService_GetUserSetting_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -51,9 +51,9 @@ func (c *userSettingServiceClient) GetUserSetting(ctx context.Context, in *GetUs return out, nil } -func (c *userSettingServiceClient) UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UpdateUserSettingResponse, error) { +func (c *userSettingServiceClient) UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateUserSettingResponse) + out := new(UserSetting) err := c.cc.Invoke(ctx, UserSettingService_UpdateUserSetting_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -66,9 +66,9 @@ func (c *userSettingServiceClient) UpdateUserSetting(ctx context.Context, in *Up // for forward compatibility. type UserSettingServiceServer interface { // GetUserSetting returns the user setting. - GetUserSetting(context.Context, *GetUserSettingRequest) (*GetUserSettingResponse, error) + GetUserSetting(context.Context, *GetUserSettingRequest) (*UserSetting, error) // UpdateUserSetting updates the user setting. - UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UpdateUserSettingResponse, error) + UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UserSetting, error) mustEmbedUnimplementedUserSettingServiceServer() } @@ -79,10 +79,10 @@ type UserSettingServiceServer interface { // pointer dereference when methods are called. type UnimplementedUserSettingServiceServer struct{} -func (UnimplementedUserSettingServiceServer) GetUserSetting(context.Context, *GetUserSettingRequest) (*GetUserSettingResponse, error) { +func (UnimplementedUserSettingServiceServer) GetUserSetting(context.Context, *GetUserSettingRequest) (*UserSetting, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserSetting not implemented") } -func (UnimplementedUserSettingServiceServer) UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UpdateUserSettingResponse, error) { +func (UnimplementedUserSettingServiceServer) UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UserSetting, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUserSetting not implemented") } func (UnimplementedUserSettingServiceServer) mustEmbedUnimplementedUserSettingServiceServer() {} diff --git a/proto/gen/apidocs.swagger.yaml b/proto/gen/apidocs.swagger.yaml index 8bb4ddb..0b3e9ac 100644 --- a/proto/gen/apidocs.swagger.yaml +++ b/proto/gen/apidocs.swagger.yaml @@ -578,7 +578,7 @@ paths: "200": description: A successful response. schema: - $ref: '#/definitions/v1GetUserSettingResponse' + $ref: '#/definitions/apiv1UserSetting' default: description: An unexpected error response. schema: @@ -599,7 +599,7 @@ paths: "200": description: A successful response. schema: - $ref: '#/definitions/v1UpdateUserSettingResponse' + $ref: '#/definitions/apiv1UserSetting' default: description: An unexpected error response. schema: @@ -1021,11 +1021,6 @@ definitions: items: type: object $ref: '#/definitions/GetShortcutAnalyticsResponseAnalyticsItem' - v1GetUserSettingResponse: - type: object - properties: - userSetting: - $ref: '#/definitions/apiv1UserSetting' v1ListCollectionsResponse: type: object properties: @@ -1125,11 +1120,6 @@ definitions: type: string required: - licenseKey - v1UpdateUserSettingResponse: - type: object - properties: - userSetting: - $ref: '#/definitions/apiv1UserSetting' v1User: type: object properties: diff --git a/server/route/api/v1/user_setting_service.go b/server/route/api/v1/user_setting_service.go index f8e65b2..769ac74 100644 --- a/server/route/api/v1/user_setting_service.go +++ b/server/route/api/v1/user_setting_service.go @@ -12,17 +12,15 @@ import ( "github.com/yourselfhosted/slash/store" ) -func (s *APIV1Service) GetUserSetting(ctx context.Context, request *v1pb.GetUserSettingRequest) (*v1pb.GetUserSettingResponse, error) { +func (s *APIV1Service) GetUserSetting(ctx context.Context, request *v1pb.GetUserSettingRequest) (*v1pb.UserSetting, error) { userSetting, err := getUserSetting(ctx, s.Store, request.Id) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user setting: %v", err) } - return &v1pb.GetUserSettingResponse{ - UserSetting: userSetting, - }, nil + return userSetting, nil } -func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.UpdateUserSettingRequest) (*v1pb.UpdateUserSettingResponse, error) { +func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.UpdateUserSettingRequest) (*v1pb.UserSetting, error) { if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is empty") } @@ -54,9 +52,7 @@ func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.Upda if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user setting: %v", err) } - return &v1pb.UpdateUserSettingResponse{ - UserSetting: userSetting, - }, nil + return userSetting, nil } func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*v1pb.UserSetting, error) {