Skip to content

Commit

Permalink
fix: query instead
Browse files Browse the repository at this point in the history
  • Loading branch information
KenZync committed Mar 30, 2024
1 parent 5727cc6 commit ea3f66c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const { data: ojn } = useAsyncData(
async () => {
if (route.query.server && route.query.id) {
loading.value = true;
if(route.query.server === 'dmjam'){
if (route.query.server === "dmjam") {
const resDeath = await $fetch(
`/api/${route.query.server}/fail/${route.query.id}`
);
Expand All @@ -145,6 +145,9 @@ const { data: ojn } = useAsyncData(
const downloadedOjn = await $fetch(
`/api/${route.query.server}/${route.query.id}`,
{
query: {
folder: route.query.folder,
},
method: "GET",
headers: {
"Content-Type": "application/octet-stream",
Expand Down
4 changes: 2 additions & 2 deletions server/api/ojn/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BoxSDK from "box-node-sdk";

export default defineEventHandler(async (event) => {
const id = getRouterParam(event, "id");
const folder = getRouterParam(event, "folder");
const query = getQuery(event);
const filename = `o2ma${id}.ojn`;

const sdk = new BoxSDK({
Expand All @@ -23,7 +23,7 @@ export default defineEventHandler(async (event) => {
const search = await client.search.query(filename, {
content_types: "name",
fields: "id,name",
ancestor_folder_ids: folder,
ancestor_folder_ids: query.folder,
limit: 1,
});

Expand Down

0 comments on commit ea3f66c

Please sign in to comment.