mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-04 03:03:18 -05:00 
			
		
		
		
	* test-commit * Remove PR Name Checker * refactor(backend): ♻️ split unrelated routes into clearer router paths Add an /app and /admin router base paths to split previously grouped public/admin data into different paths. Part of a longer migration to move 'admin' operations under the admin path. * refactor(backend): ♻️ rename imports * refactor(frontend): ♻️ refactor frontend API and Pages to refelect new API design Co-authored-by: hay-kot <hay-kot@pm.me>
		
			
				
	
	
		
			38 lines
		
	
	
		
			759 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			759 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { BaseAPI } from "./_base";
 | 
						|
 | 
						|
const prefix = "/api";
 | 
						|
 | 
						|
const routes = {
 | 
						|
  about: `${prefix}/admin/about`,
 | 
						|
  aboutStatistics: `${prefix}/admin/about/statistics`,
 | 
						|
};
 | 
						|
 | 
						|
export interface AdminAboutInfo {
 | 
						|
  production: boolean;
 | 
						|
  version: string;
 | 
						|
  demoStatus: boolean;
 | 
						|
  apiPort: number;
 | 
						|
  apiDocs: boolean;
 | 
						|
  dbType: string;
 | 
						|
  dbUrl: string;
 | 
						|
  defaultGroup: string;
 | 
						|
}
 | 
						|
 | 
						|
export interface AdminStatistics {
 | 
						|
  totalRecipes: number;
 | 
						|
  totalUsers: number;
 | 
						|
  totalGroups: number;
 | 
						|
  uncategorizedRecipes: number;
 | 
						|
  untaggedRecipes: number;
 | 
						|
}
 | 
						|
 | 
						|
export class AdminAboutAPI extends BaseAPI {
 | 
						|
  async about() {
 | 
						|
    return await this.requests.get<AdminAboutInfo>(routes.about);
 | 
						|
  }
 | 
						|
 | 
						|
  async statistics() {
 | 
						|
    return await this.requests.get(routes.aboutStatistics);
 | 
						|
  }
 | 
						|
}
 |