chore: update frontend buf generator

This commit is contained in:
Steven 2024-03-06 00:22:31 +08:00
parent 29043f63b6
commit 7c16b1e00f
5 changed files with 8 additions and 4 deletions

View File

@ -113,7 +113,7 @@ const CreateCollectionDrawer: React.FC<Props> = (props: Props) => {
const handleVisibilityInputChange = (e: React.ChangeEvent<HTMLInputElement>) => { const handleVisibilityInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setPartialState({ setPartialState({
collectionCreate: Object.assign(state.collectionCreate, { collectionCreate: Object.assign(state.collectionCreate, {
visibility: Number(e.target.value), visibility: e.target.value,
}), }),
}); });
}; };

View File

@ -128,7 +128,7 @@ const CreateShortcutDrawer: React.FC<Props> = (props: Props) => {
const handleVisibilityInputChange = (e: React.ChangeEvent<HTMLInputElement>) => { const handleVisibilityInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setPartialState({ setPartialState({
shortcutCreate: Object.assign(state.shortcutCreate, { shortcutCreate: Object.assign(state.shortcutCreate, {
visibility: Number(e.target.value), visibility: e.target.value,
}), }),
}); });
}; };

View File

@ -54,7 +54,7 @@ const useUserStore = create<UserState>()((set, get) => ({
} }
const { user } = await userServiceClient.getUser({ const { user } = await userServiceClient.getUser({
id: Number(id), id: id,
}); });
if (!user) { if (!user) {
throw new Error("User not found"); throw new Error("User not found");

View File

@ -24,20 +24,24 @@ plugins:
# reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md#using-ts-proto # reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md#using-ts-proto
opt: opt:
- env=browser - env=browser
- useOptionals=messages
- outputServices=generic-definitions - outputServices=generic-definitions
- outputJsonMethods=false - outputJsonMethods=false
- useExactTypes=false - useExactTypes=false
- esModuleInterop=true - esModuleInterop=true
- stringEnums=true
# Generate types for the extension client. # Generate types for the extension client.
- plugin: buf.build/community/stephenh-ts-proto:v1.152.1 - plugin: buf.build/community/stephenh-ts-proto:v1.152.1
out: ../frontend/extension/src/types/proto out: ../frontend/extension/src/types/proto
# reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md#using-ts-proto # reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md#using-ts-proto
opt: opt:
- env=browser - env=browser
- useOptionals=messages
- outputServices=generic-definitions - outputServices=generic-definitions
- outputJsonMethods=false - outputJsonMethods=false
- useExactTypes=false - useExactTypes=false
- esModuleInterop=true - esModuleInterop=true
- stringEnums=true
- plugin: buf.build/community/pseudomuto-doc:v1.5.1 - plugin: buf.build/community/pseudomuto-doc:v1.5.1
out: gen out: gen
opt: opt:

View File

@ -8,7 +8,7 @@ var allowedMethodsWhenUnauthorized = map[string]bool{
"/slash.api.v1.AuthService/SignIn": true, "/slash.api.v1.AuthService/SignIn": true,
"/slash.api.v1.AuthService/SignUp": true, "/slash.api.v1.AuthService/SignUp": true,
"/slash.api.v1.AuthService/SignOut": true, "/slash.api.v1.AuthService/SignOut": true,
"/memos.api.v1.AuthService/GetAuthStatus": true, "/slash.api.v1.AuthService/GetAuthStatus": true,
"/slash.api.v1.ShortcutService/GetShortcutByName": true, "/slash.api.v1.ShortcutService/GetShortcutByName": true,
"/slash.api.v1.ShortcutService/GetShortcut": true, "/slash.api.v1.ShortcutService/GetShortcut": true,
"/slash.api.v1.CollectionService/GetCollectionByName": true, "/slash.api.v1.CollectionService/GetCollectionByName": true,