mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-28 06:38:36 +00:00
frontend: cleanup
* dummy commit * cleanup workflows * setup and run eslint * add linter to CI * use eslint for formatting * reorder rules * drop editor config
This commit is contained in:
parent
78fa714297
commit
75c633dcb5
65 changed files with 2048 additions and 641 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Requests } from '../../requests';
|
||||
import { Requests } from "../../requests";
|
||||
// <
|
||||
// TGetResult,
|
||||
// TPostData,
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
import { route } from '.';
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { route } from ".";
|
||||
|
||||
describe('UrlBuilder', () => {
|
||||
it('basic query parameter', () => {
|
||||
const result = route('/test', { a: 'b' });
|
||||
expect(result).toBe('/api/v1/test?a=b');
|
||||
describe("UrlBuilder", () => {
|
||||
it("basic query parameter", () => {
|
||||
const result = route("/test", { a: "b" });
|
||||
expect(result).toBe("/api/v1/test?a=b");
|
||||
});
|
||||
|
||||
it('multiple query parameters', () => {
|
||||
const result = route('/test', { a: 'b', c: 'd' });
|
||||
expect(result).toBe('/api/v1/test?a=b&c=d');
|
||||
it("multiple query parameters", () => {
|
||||
const result = route("/test", { a: "b", c: "d" });
|
||||
expect(result).toBe("/api/v1/test?a=b&c=d");
|
||||
});
|
||||
|
||||
it('no query parameters', () => {
|
||||
const result = route('/test');
|
||||
expect(result).toBe('/api/v1/test');
|
||||
it("no query parameters", () => {
|
||||
const result = route("/test");
|
||||
expect(result).toBe("/api/v1/test");
|
||||
});
|
||||
|
||||
it('list-like query parameters', () => {
|
||||
const result = route('/test', { a: ['b', 'c'] });
|
||||
expect(result).toBe('/api/v1/test?a=b&a=c');
|
||||
it("list-like query parameters", () => {
|
||||
const result = route("/test", { a: ["b", "c"] });
|
||||
expect(result).toBe("/api/v1/test?a=b&a=c");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
export { BaseAPI } from './base-api';
|
||||
export { route } from './urls';
|
||||
export { BaseAPI } from "./base-api";
|
||||
export { route } from "./urls";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const parts = {
|
||||
host: 'http://localhost.com',
|
||||
prefix: '/api/v1',
|
||||
host: "http://localhost.com",
|
||||
prefix: "/api/v1",
|
||||
};
|
||||
|
||||
export function overrideParts(host: string, prefix: string) {
|
||||
|
@ -32,5 +32,5 @@ export function route(rest: string, params: Record<string, QueryValue> = {}): st
|
|||
}
|
||||
}
|
||||
|
||||
return url.toString().replace('http://localhost.com', '');
|
||||
return url.toString().replace("http://localhost.com", "");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue