Skip to content

Commit

Permalink
format everyting
Browse files Browse the repository at this point in the history
  • Loading branch information
Boegie19 authored and ResuBaka committed Jul 8, 2024
1 parent e6048bb commit 4327a60
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

const rows1 = getItemRowsFromRows(readItemRows());
const rows2 = getCargoDescRowsFromRows(readCargoDescRows());
const rows = [...rows1,...rows2]
const rows = [...rows1, ...rows2];
export default defineEventHandler((event) => {
const id = getRouterParam(event, "id", { decode: true });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineEventHandler<ItemResponse>((event) => {

const rows1 = getItemRowsFromRows(readItemRows());
const rows2 = getCargoDescRowsFromRows(readCargoDescRows());
const rows = [...rows1,...rows2]
const rows = [...rows1, ...rows2];
if (tier) {
tier = parseInt(tier);
}
Expand Down
67 changes: 35 additions & 32 deletions pages/items/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,42 @@ if (route.query.page) {
page.value = parseInt(route.query.page);
}
const { data, pending, refresh } = await useLazyFetch(`/api/bitcraft/itemsAndCargo`, {
onRequest: ({ options }) => {
options.query = options.query || {};
if (search.value) {
options.query.search = search.value;
}
if (page.value) {
options.query.page = page.value;
}
if (tag.value) {
options.query.tag = tag.value;
}
if (tier.value) {
options.query.tier = tier.value;
}
if (perPage) {
options.query.perPage = perPage;
}
if (Object.keys(options.query).length > 2) {
const query = { ...options.query };
delete query.perPage;
router.push({ query });
} else if (options.query.page <= 1) {
router.push({});
}
const { data, pending, refresh } = await useLazyFetch(
`/api/bitcraft/itemsAndCargo`,
{
onRequest: ({ options }) => {
options.query = options.query || {};
if (search.value) {
options.query.search = search.value;
}
if (page.value) {
options.query.page = page.value;
}
if (tag.value) {
options.query.tag = tag.value;
}
if (tier.value) {
options.query.tier = tier.value;
}
if (perPage) {
options.query.perPage = perPage;
}
if (Object.keys(options.query).length > 2) {
const query = { ...options.query };
delete query.perPage;
router.push({ query });
} else if (options.query.page <= 1) {
router.push({});
}
},
},
});
);
const changePage = (value: number) => {
page.value = value;
Expand Down

0 comments on commit 4327a60

Please sign in to comment.