Skip to content

Commit

Permalink
chore: update ts definition generator
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Sep 3, 2023
1 parent 2fcd496 commit 65e366f
Show file tree
Hide file tree
Showing 39 changed files with 2,065 additions and 12,002 deletions.
2 changes: 1 addition & 1 deletion frontend/web/src/components/setting/AccessTokenSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from "axios";
import copy from "copy-to-clipboard";
import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { ListUserAccessTokensResponse, UserAccessToken } from "@/types/proto/api/v2/user_service";
import { ListUserAccessTokensResponse, UserAccessToken } from "@/types/proto/api/v2/user_service_pb";
import useUserStore from "../../stores/v1/user";
import { showCommonDialog } from "../Alert";
import CreateAccessTokenDialog from "../CreateAccessTokenDialog";
Expand Down
6 changes: 3 additions & 3 deletions frontend/web/src/layouts/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { Outlet, useNavigate } from "react-router-dom";
import { UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service";
import { UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service_pb";
import Header from "../components/Header";
import useUserStore from "../stores/v1/user";

Expand Down Expand Up @@ -29,9 +29,9 @@ const Root: React.FC = () => {
return;
}

if (currentUserSetting.locale === UserSetting_Locale.LOCALE_EN) {
if (currentUserSetting.locale === UserSetting_Locale.EN) {
i18n.changeLanguage("en");
} else if (currentUserSetting.locale === UserSetting_Locale.LOCALE_ZH) {
} else if (currentUserSetting.locale === UserSetting_Locale.ZH) {
i18n.changeLanguage("zh");
}
}, [currentUserSetting]);
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/src/stores/v1/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";
import { create } from "zustand";
import { GetUserSettingResponse, UserSetting } from "@/types/proto/api/v2/user_setting_service";
import { GetUserSettingResponse, UserSetting } from "@/types/proto/api/v2/user_setting_service_pb";
import * as api from "../../helpers/api";

const convertResponseModelUser = (user: User): User => {
Expand Down
42 changes: 0 additions & 42 deletions frontend/web/src/types/proto/api/v2/common.ts

This file was deleted.

25 changes: 25 additions & 0 deletions frontend/web/src/types/proto/api/v2/common_pb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/common.proto (package slash.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck

/**
* @generated from enum slash.api.v2.RowStatus
*/
export declare enum RowStatus {
/**
* @generated from enum value: ROW_STATUS_UNSPECIFIED = 0;
*/
ROW_STATUS_UNSPECIFIED = 0,

/**
* @generated from enum value: NORMAL = 1;
*/
NORMAL = 1,

/**
* @generated from enum value: ARCHIVED = 2;
*/
ARCHIVED = 2,
}

19 changes: 19 additions & 0 deletions frontend/web/src/types/proto/api/v2/common_pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/common.proto (package slash.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { proto3 } from "@bufbuild/protobuf";

/**
* @generated from enum slash.api.v2.RowStatus
*/
export const RowStatus = proto3.makeEnum(
"slash.api.v2.RowStatus",
[
{no: 0, name: "ROW_STATUS_UNSPECIFIED"},
{no: 1, name: "NORMAL"},
{no: 2, name: "ARCHIVED"},
],
);

Loading

0 comments on commit 65e366f

Please sign in to comment.