Run npm lint:fix

This commit is contained in:
2025-05-18 16:57:48 +02:00
parent 16fbbec992
commit 2f181d0f7f
34 changed files with 85 additions and 68 deletions

View File

@@ -1,12 +1,15 @@
import { apiCall } from './api';
import { API_BASE_URL, isUser, User } from '../types/authApi';
import {
import type { User } from '../types/authApi';
import { API_BASE_URL, isUser } from '../types/authApi';
import type {
CreateUserRequest,
isSystemStats,
SystemStats,
UpdateUserRequest,
UpdateUserRequest} from '@/types/adminApi';
import {
isSystemStats
} from '@/types/adminApi';
import { isWorkspace, Workspace } from '@/types/workspace';
import type { Workspace } from '@/types/workspace';
import { isWorkspace } from '@/types/workspace';
const ADMIN_BASE_URL = `${API_BASE_URL}/admin`;
@@ -28,7 +31,7 @@ export const getUsers = async (): Promise<User[]> => {
if (!isUser(user)) {
throw new Error('Invalid user object received from API');
}
return user as User;
return user;
});
};
@@ -50,7 +53,7 @@ export const createUser = async (
if (!isUser(data)) {
throw new Error('Invalid user object received from API');
}
return data as User;
return data;
};
/**
@@ -89,7 +92,7 @@ export const updateUser = async (
if (!isUser(data)) {
throw new Error('Invalid user object received from API');
}
return data as User;
return data;
};
// Workspace Management
@@ -109,7 +112,7 @@ export const getWorkspaces = async (): Promise<Workspace[]> => {
if (!isWorkspace(workspace)) {
throw new Error('Invalid workspace object received from API');
}
return workspace as Workspace;
return workspace;
});
};
@@ -126,5 +129,5 @@ export const getSystemStats = async (): Promise<SystemStats> => {
if (!isSystemStats(data)) {
throw new Error('Invalid system stats response received from API');
}
return data as SystemStats;
return data;
};

View File

@@ -1,4 +1,5 @@
import { API_BASE_URL, User, LoginRequest, isUser } from '../types/authApi';
import type { User, LoginRequest} from '../types/authApi';
import { API_BASE_URL, isUser } from '../types/authApi';
import { apiCall } from './api';
/**

View File

@@ -1,12 +1,13 @@
import { API_BASE_URL } from '@/types/authApi';
import { apiCall } from './api';
import {
import type {
FileNode,
LookupResponse,
SaveFileResponse} from '@/types/fileApi';
import {
isFileNode,
isLookupResponse,
isSaveFileResponse,
LookupResponse,
SaveFileResponse,
isSaveFileResponse
} from '@/types/fileApi';
/**
@@ -27,7 +28,7 @@ export const listFiles = async (workspaceName: string): Promise<FileNode[]> => {
if (!isFileNode(file)) {
throw new Error('Invalid file object received from API');
}
return file as FileNode;
return file;
});
};
@@ -51,7 +52,7 @@ export const lookupFileByName = async (
if (!isLookupResponse(data)) {
throw new Error('Invalid lookup response received from API');
}
const lookupResponse = data as LookupResponse;
const lookupResponse = data;
return lookupResponse.paths;
};
@@ -103,7 +104,7 @@ export const saveFile = async (
if (!isSaveFileResponse(data)) {
throw new Error('Invalid save file response received from API');
}
return data as SaveFileResponse;
return data;
};
/**

View File

@@ -1,6 +1,6 @@
import { API_BASE_URL } from '@/types/authApi';
import { apiCall } from './api';
import { CommitHash } from '@/types/git';
import type { CommitHash } from '@/types/git';
/**
* pullChanges fetches the latest changes from the remote repository

View File

@@ -1,6 +1,7 @@
import { API_BASE_URL, isUser, User } from '@/types/authApi';
import type { User } from '@/types/authApi';
import { API_BASE_URL, isUser } from '@/types/authApi';
import { apiCall } from './api';
import { UpdateProfileRequest } from '@/types/userApi';
import type { UpdateProfileRequest } from '@/types/userApi';
/**
* updateProfile updates the user's profile information.

View File

@@ -1,6 +1,7 @@
import { API_BASE_URL } from '@/types/authApi';
import { apiCall } from './api';
import { isWorkspace, Workspace } from '@/types/workspace';
import type { Workspace } from '@/types/workspace';
import { isWorkspace } from '@/types/workspace';
/**
* listWorkspaces fetches the list of workspaces
@@ -17,7 +18,7 @@ export const listWorkspaces = async (): Promise<Workspace[]> => {
if (!isWorkspace(workspace)) {
throw new Error('Invalid workspace object received from API');
}
return workspace as Workspace;
return workspace;
});
};
@@ -39,7 +40,7 @@ export const createWorkspace = async (name: string): Promise<Workspace> => {
if (!isWorkspace(data)) {
throw new Error('Invalid workspace object received from API');
}
return data as Workspace;
return data;
};
/**