fix broken URLs for query

This commit is contained in:
Hayden 2023-03-23 10:16:24 -08:00
parent dd714573e8
commit 9015034387
No known key found for this signature in database
GPG key ID: 17CF79474E257545
3 changed files with 2 additions and 12 deletions

View file

@ -39,7 +39,7 @@ In some cases you may want to skip some items such as consumables, or items that
Homebox has a built-in QR code generator that can be used to generate QR codes for your items. This is useful for tracking items with a mobile device. You can generate a QR code for any item by clicking the QR code icon in the top right of the item details page. The same can be done for the Labels and Locations page. Currently support is limited to generating one off QR Codes.
However, the API endpoint is available for generating QR codes on the fly for any item (or any other data) if you provide a valid API key in the query parameters. An example url would look like `/api/v1/qrcode?data=https://homebox.fly.dev/item/{uuid}&access_token={api_key}`. Currently the easiest way to get an API token is to use one from an existing URL of the QR Code in the API key, but this will be improved in the future.
However, the API endpoint is available for generating QR codes on the fly for any item (or any other data) if you provide a valid API key in the query parameters. An example url would look like `/api/v1/qrcode?data=https://homebox.fly.dev/item/{uuid}`. Currently the easiest way to get an API token is to use one from an existing URL of the QR Code in the API key, but this will be improved in the future.
:octicons-tag-24: v0.8.0

View file

@ -70,16 +70,6 @@ export class BaseAPI {
this.attachmentToken = attachmentToken;
}
// if a attachmentToken is present it will be added to URL as a query param
// this is done with a simple appending of the query param to the URL. If your
// URL already has a query param, this will not work.
authURL(url: string): string {
if (this.attachmentToken) {
return `/api/v1${url}?access_token=${this.attachmentToken}`;
}
return url;
}
/**
* dropFields will remove any fields that are specified in the fields array
* additionally, it will remove the `createdAt` and `updatedAt` fields if they

View file

@ -178,7 +178,7 @@
const data = `${origin}/a/${assetID}`;
return `/api/v1/qrcode?data=${encodeURIComponent(data)}&access_token=${api.items.attachmentToken}`;
return `/api/v1/qrcode?data=${encodeURIComponent(data)}`;
}
function getItem(n: number): LabelData {