move build to cmd
This commit is contained in:
parent
734cf55122
commit
14f06a4ddb
|
@ -7,9 +7,12 @@ import Table from "../components/Table";
|
||||||
import authServerSideProps from "../services/authServerSideProps";
|
import authServerSideProps from "../services/authServerSideProps";
|
||||||
import { SkynetClient } from "skynet-js";
|
import { SkynetClient } from "skynet-js";
|
||||||
|
|
||||||
const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API);
|
|
||||||
const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : "";
|
const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : "";
|
||||||
const fetcher = (url) => fetch(url).then((r) => r.json());
|
const fetcher = (url) => fetch(url).then((r) => r.json());
|
||||||
|
|
||||||
|
export const getServerSideProps = authServerSideProps();
|
||||||
|
export const getStaticProps = () => {
|
||||||
|
const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API);
|
||||||
const getSkylinkLink = ({ skylink }) => skynetClient.getSkylinkUrl(skylink);
|
const getSkylinkLink = ({ skylink }) => skynetClient.getSkylinkUrl(skylink);
|
||||||
const getRelativeDate = ({ uploadedOn }) => dayjs(uploadedOn).format("YYYY-MM-DD HH:mm:ss");
|
const getRelativeDate = ({ uploadedOn }) => dayjs(uploadedOn).format("YYYY-MM-DD HH:mm:ss");
|
||||||
const headers = [
|
const headers = [
|
||||||
|
@ -20,9 +23,10 @@ const headers = [
|
||||||
];
|
];
|
||||||
const actions = [];
|
const actions = [];
|
||||||
|
|
||||||
export const getServerSideProps = authServerSideProps();
|
return { props: { headers, actions } };
|
||||||
|
};
|
||||||
|
|
||||||
export default function Uploads() {
|
export default function Uploads({ headers, actions }) {
|
||||||
const [offset, setOffset] = useState(0);
|
const [offset, setOffset] = useState(0);
|
||||||
const { data, error } = useSWR(`${apiPrefix}/user/uploads?pageSize=10&offset=${offset}`, fetcher);
|
const { data, error } = useSWR(`${apiPrefix}/user/uploads?pageSize=10&offset=${offset}`, fetcher);
|
||||||
|
|
||||||
|
|
Reference in New Issue