Exploit databaseDownload repository ZIP
GH-8314079936adc0a0272c0784ab43e406
ahmedhanyonly/nextjs-admin-dashboard-main
Sources for CVE-2025-29927
158 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files8
ahmedhanyonly/nextjs-admin-dashboard-mainRevision b8ebd7d104ba
- ↑..Parent directory
- auth.ts
- categories.ts
- clients.ts
- paymentMethods.ts
- products.ts
- selectedData.ts
- units.ts
- users.ts
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/api/methods/units.ts
TypeScript · 1,131 bytesimport api from '@/api/api';
export interface Unit {
id: number;
name: string;
}
export interface UnitsResponse {
status: boolean;
message: string;
data: Unit[];
pagination: {
current_page: number;
last_page: number;
per_page: number;
from: number;
to: number;
total: number;
};
}
// 🟢 جلب كل الوحدات
export async function getUnits(): Promise<Unit[]> {
const { data } = await api.get<UnitsResponse>('/api/units');
return data.data;
}
// 🟢 إنشاء وحدة
export async function createUnit(unitData: Omit<Unit, 'id'>): Promise<Unit> {
const { data } = await api.post<{ data: Unit }>('/api/units', unitData);
return data.data;
}
// 🟢 تعديل وحدة
export async function updateUnit(
id: number,
unitData: Partial<Omit<Unit, 'id'>>
): Promise<Unit> {
const { data } = await api.put<{ data: Unit }>(`/api/units/${id}`, unitData);
return data.data;
}
// 🟢 حذف وحدة
export async function deleteUnit(id: number): Promise<{ message: string }> {
const { data } = await api.delete<{ message: string }>(`/api/units/${id}`);
return data;
}