Add admin status deletion endpoint
This commit is contained in:
parent
8f66e49db8
commit
31a6d0305f
|
@ -44,7 +44,12 @@ import { instanceController } from './controllers/api/instance.ts';
|
|||
import { mediaController } from './controllers/api/media.ts';
|
||||
import { notificationsController } from './controllers/api/notifications.ts';
|
||||
import { createTokenController, oauthAuthorizeController, oauthController } from './controllers/api/oauth.ts';
|
||||
import { configController, frontendConfigController, updateConfigController } from './controllers/api/pleroma.ts';
|
||||
import {
|
||||
configController,
|
||||
frontendConfigController,
|
||||
pleromaAdminDeleteStatusController,
|
||||
updateConfigController,
|
||||
} from './controllers/api/pleroma.ts';
|
||||
import { preferencesController } from './controllers/api/preferences.ts';
|
||||
import { relayController } from './controllers/nostr/relay.ts';
|
||||
import { searchController } from './controllers/api/search.ts';
|
||||
|
@ -189,6 +194,7 @@ app.get('/api/v1/blocks', requirePubkey, blocksController);
|
|||
app.get('/api/v1/admin/accounts', adminAccountsController);
|
||||
app.get('/api/v1/pleroma/admin/config', requireRole('admin'), configController);
|
||||
app.post('/api/v1/pleroma/admin/config', requireRole('admin'), updateConfigController);
|
||||
app.delete('/api/v1/pleroma/admin/statuses/:id', requireRole('admin'), pleromaAdminDeleteStatusController);
|
||||
|
||||
// Not (yet) implemented.
|
||||
app.get('/api/v1/custom_emojis', emptyArrayController);
|
||||
|
|
|
@ -85,4 +85,13 @@ const updateConfigController: AppController = async (c) => {
|
|||
return c.json({ configs: newConfigs, need_reboot: false });
|
||||
};
|
||||
|
||||
export { configController, frontendConfigController, updateConfigController };
|
||||
const pleromaAdminDeleteStatusController: AppController = async (c) => {
|
||||
await createAdminEvent({
|
||||
kind: 5,
|
||||
tags: [['e', c.req.param('id')]],
|
||||
}, c);
|
||||
|
||||
return c.json({});
|
||||
};
|
||||
|
||||
export { configController, frontendConfigController, pleromaAdminDeleteStatusController, updateConfigController };
|
||||
|
|
Loading…
Reference in New Issue