chore: prefer ??
This commit is contained in:
parent
1d93812899
commit
13c4c9a5a1
@ -87,14 +87,14 @@ export default function StatusTable(props: StatusTableProps) {
|
|||||||
},
|
},
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const cur = params.current || 1;
|
const cur = params.current ?? 1;
|
||||||
const size = params.pageSize || 10;
|
const size = params.pageSize ?? 10;
|
||||||
|
|
||||||
const res = await StatusApi.Query(
|
const res = await StatusApi.Query(
|
||||||
{
|
{
|
||||||
pid: props.pid,
|
pid: props.pid,
|
||||||
uid: props.uid,
|
uid: props.uid,
|
||||||
offset: (cur - 1) * (size || 10),
|
offset: (cur - 1) * size,
|
||||||
limit: size,
|
limit: size,
|
||||||
},
|
},
|
||||||
props.token,
|
props.token,
|
||||||
|
@ -73,13 +73,13 @@ export default function SearchPage() {
|
|||||||
},
|
},
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const cur = params.current || 1;
|
const cur = params.current ?? 1;
|
||||||
const size = params.pageSize || 10;
|
const size = params.pageSize ?? 10;
|
||||||
|
|
||||||
const info = await ProblemApi.Search({
|
const info = await ProblemApi.Search({
|
||||||
keyword: params.title || "",
|
keyword: params.title ?? "",
|
||||||
tag: params.tags || "",
|
tag: params.tags ?? "",
|
||||||
offset: (cur - 1) * (size || 10),
|
offset: (cur - 1) * size,
|
||||||
limit: size,
|
limit: size,
|
||||||
});
|
});
|
||||||
const data = info.data.map((i) => {
|
const data = info.data.map((i) => {
|
||||||
|
Reference in New Issue
Block a user