Skip to content

Commit a1fc9cb

Browse files
MytsVmaany
authored andcommitted
Move queries out of the separate file
1 parent 2dd6dc9 commit a1fc9cb

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

src/app/(rucio)/rse/page/[name]/page.tsx

+18-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ import { PageRSE as PageRSEStory } from "@/component-library/Pages/RSE/PageRSE";
44
import { RSEBlockState } from "@/lib/core/entity/rucio";
55
import { RSEAttributeViewModel, RSEProtocolViewModel, RSEViewModel } from "@/lib/infrastructure/data/view-model/rse";
66
import { useEffect, useState } from "react";
7-
import { getAttributes, getProtocols, getRSE } from "../../queries";
7+
8+
async function getRSE(rseName: string): Promise<RSEViewModel> {
9+
const url = `${process.env.NEXT_PUBLIC_WEBUI_HOST}/api/feature/get-rse?` + new URLSearchParams({rseName})
10+
const res = await fetch(url)
11+
return await res.json()
12+
}
13+
14+
async function getProtocols(rseName: string): Promise<RSEProtocolViewModel> {
15+
const url = `${process.env.NEXT_PUBLIC_WEBUI_HOST}/api/feature/get-rse-protocols?` + new URLSearchParams({rseName})
16+
const res = await fetch(url)
17+
return await res.json()
18+
}
19+
20+
async function getAttributes(rseName:string): Promise<RSEAttributeViewModel> {
21+
const url = `${process.env.NEXT_PUBLIC_WEBUI_HOST}/api/feature/get-rse-attributes?` + new URLSearchParams({rseName})
22+
const res = await fetch(url)
23+
return await res.json()
24+
}
825

926
export default function Page({ params }: { params: { name: string } }) {
1027
const [rse, setRSE] = useState<RSEViewModel>({status: "pending"} as RSEViewModel)

src/app/(rucio)/rse/queries.ts

-19
This file was deleted.

0 commit comments

Comments
 (0)