Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 29, 2024
1 parent 69d2914 commit 0ecbc75
Show file tree
Hide file tree
Showing 79 changed files with 3,307 additions and 2,960 deletions.
12 changes: 6 additions & 6 deletions frontend/openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig } from '@hey-api/openapi-ts';
import { defineConfig } from "@hey-api/openapi-ts";

export default defineConfig({
client: '@hey-api/client-fetch',
input: '../mondey_backend/openapi.json',
client: "@hey-api/client-fetch",
input: "../mondey_backend/openapi.json",
output: {
path: 'src/lib/client',
format: 'prettier'
}
path: "src/lib/client",
format: "prettier",
},
});
4 changes: 2 additions & 2 deletions frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
autoprefixer: {},
},
};
6 changes: 3 additions & 3 deletions frontend/src/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
28 changes: 14 additions & 14 deletions frontend/src/lib/admin.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { milestoneGroups, userQuestions } from '$lib/stores/adminStore';
import {
authCookieLogin,
getMilestoneGroupsAdmin,
getUserQuestionsAdmin,
usersCurrentUser
} from '$lib/client/services.gen';
usersCurrentUser,
} from "$lib/client/services.gen";
import type {
Body_auth_cookie_login_auth_login_post,
GetLanguagesResponse,
MilestoneGroupAdmin,
UserQuestionAdmin,
UserRead,
Body_auth_cookie_login_auth_login_post
} from '$lib/client/types.gen';
} from "$lib/client/types.gen";
import { milestoneGroups, userQuestions } from "$lib/stores/adminStore";

function AdminUser() {
let user = $state(null as UserRead | null);
Expand All @@ -26,30 +26,30 @@ function AdminUser() {
} else {
await this.refresh();
if (!user || !user.is_superuser) {
return 'Admin account required';
return "Admin account required";
}
return '';
return "";
}
},
refresh: async function () {
refresh: async () => {
const { data, error } = await usersCurrentUser();
if (error || data === undefined) {
console.log('Failed to get current User');
console.log("Failed to get current User");
user = null;
} else {
user = data;
}
}
},
};
}

export const adminUser = AdminUser();

export async function refreshMilestoneGroups() {
console.log('refreshMilestoneGroups...');
console.log("refreshMilestoneGroups...");
const { data, error } = await getMilestoneGroupsAdmin();
if (error || data == undefined) {
console.log('Failed to get MilestoneGroups');
console.log("Failed to get MilestoneGroups");
milestoneGroups.set([]);
} else {
milestoneGroups.set(data);
Expand All @@ -61,10 +61,10 @@ export function milestoneGroupImageUrl(id: number) {
}

export async function refreshUserQuestions() {
console.log('refreshQuestions...');
console.log("refreshQuestions...");
const { data, error } = await getUserQuestionsAdmin();
if (error || data === undefined) {
console.log('Failed to get UserQuestions');
console.log("Failed to get UserQuestions");
userQuestions.set([]);
} else {
userQuestions.set(data);
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export * from './schemas.gen';
export * from './services.gen';
export * from './types.gen';
export * from "./schemas.gen";
export * from "./services.gen";
export * from "./types.gen";
Loading

0 comments on commit 0ecbc75

Please sign in to comment.