Skip to content

Commit

Permalink
fix(web): id -> _id
Browse files Browse the repository at this point in the history
  • Loading branch information
LeezQ committed May 29, 2023
1 parent a4cc073 commit 1bd3ab0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion web/src/pages/app/functions/mods/FunctionPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default function FunctionList() {
<span className="ml-2 text-base">{func?.name}</span>
</div>
<HStack spacing={1}>
{functionCache.getCache(func?.id, func?.source?.code) !==
{functionCache.getCache(func?._id, func?.source?.code) !==
func?.source?.code && (
<span className="mt-[1px] inline-block h-1 w-1 flex-none rounded-full bg-warn-700"></span>
)}
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/app/functions/mods/TriggerModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function TriggerModal(props: { children: React.ReactElement }) {
return item.desc.indexOf(searchKey) > -1;
})
.map((item: any) => (
<Tr key={item.id} _hover={{ bgColor: "#FBFBFC" }}>
<Tr key={item._id} _hover={{ bgColor: "#FBFBFC" }}>
<Td borderTopLeftRadius={"10px"} borderBottomLeftRadius={"10px"}>
<span>{item.desc}</span>
</Td>
Expand All @@ -128,7 +128,7 @@ export default function TriggerModal(props: { children: React.ReactElement }) {
<HStack spacing={1}>
<ConfirmButton
onSuccessAction={() =>
deleteTriggerMutation.mutate({ id: item.id })
deleteTriggerMutation.mutate({ id: item._id })
}
headerText={String(t("Delete"))}
bodyText={t("TriggerPanel.DeleteConfirm")}
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/app/functions/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const useDeleteFunctionMutation = () => {
if (!data.error) {
queryClient.invalidateQueries(queryKeys.useFunctionListQuery);
store.setCurrentFunction({});
functionCache.removeCache(data?.data?.id);
functionCache.removeCache(data?.data?._id);
}
},
},
Expand Down
4 changes: 3 additions & 1 deletion web/src/pages/app/mods/SideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export default function SideBar() {
const { pageId } = useParams();
const navigate = useNavigate();
const { currentApp, setCurrentPage, userInfo, regions = [] } = useGlobalStore();
const currentRegion = regions.find((item: any) => item.id === currentApp?.regionId) || regions[0];
const currentRegion =
regions.find((item: any) => item._id === currentApp?.regionId) || regions[0];

const ICONS: TIcon[] = [
{
pageId: "nav",
Expand Down
10 changes: 5 additions & 5 deletions web/src/pages/app/setting/PATList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const PATList = () => {
const addPATMutation = useAddPATMutation((data: any) => {
const newTokenList = [...tokenList];
newTokenList.push({
id: data.id,
id: data._id,
token: data.token,
});
setTokenList(newTokenList);
Expand Down Expand Up @@ -70,13 +70,13 @@ const PATList = () => {
},
]}
configuration={{
key: "id",
key: "_id",
tableHeight: "40vh",
hiddenEditButton: true,
addButtonText: t("Add") + "Token",
saveButtonText: t("Generate") + "Token",
operationButtonsRender: (data: any) => {
const tokenItem = tokenList?.filter((item) => item.id === data.id);
const tokenItem = tokenList?.filter((item: any) => item._id === data._id);
return tokenItem?.length === 1 ? (
<CopyText className="mr-4" text={tokenItem[0].token} tip={t("Copied").toString()}>
<TextButton text={t("Copy") + "Token"} />
Expand All @@ -88,8 +88,8 @@ const PATList = () => {
onEdit={async () => {}}
onDelete={async (data) => {
await delPATMutation.mutateAsync({ id: data });
const newTokenList = tokenList.filter((token) => {
return token.id !== data;
const newTokenList = tokenList.filter((token: any) => {
return token._id !== data;
});
setTokenList(newTokenList);
}}
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/app/storages/mods/StorageListPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function StorageListPanel() {
store.setCurrentStorage(data?.data[0]);
} else {
store.setCurrentStorage(
data?.data?.filter((item: any) => item.id === store?.currentStorage?._id)[0],
data?.data?.filter((item: any) => item._id === store?.currentStorage?._id)[0],
);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/home/mods/CreateAppModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const CreateAppModal = (props: {
};

const currentRegion =
regions.find((item: any) => item.id === application?.regionId) || regions[0];
regions.find((item: any) => item._id === application?.regionId) || regions[0];

const bundles = currentRegion.bundles;

Expand Down

0 comments on commit 1bd3ab0

Please sign in to comment.