Initial miaojingAI project with image resolution guard
This commit is contained in:
23
verify_gallery_delete_admin.js
Normal file
23
verify_gallery_delete_admin.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const base = 'http://127.0.0.1:5000';
|
||||
|
||||
(async () => {
|
||||
const profileRes = await fetch(`${base}/api/profile?email=admin@example.com`);
|
||||
const profileData = await profileRes.json();
|
||||
const adminId = profileData.profile && profileData.profile.id;
|
||||
if (!adminId) throw new Error('admin profile not found');
|
||||
const token = `token-admin-${adminId}-${Date.now()}`;
|
||||
|
||||
const res = await fetch(`${base}/api/gallery`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
body: JSON.stringify({ ids: ['00000000-0000-0000-0000-000000000000'] }),
|
||||
});
|
||||
const body = await res.text();
|
||||
console.log(JSON.stringify({ status: res.status, body }, null, 2));
|
||||
})().catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user