From 3ed1ca68e52527f74103e1a57ae48ae533508c3a Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:55:17 +0200 Subject: [feature] Store admin actions in the db, prevent conflicting actions (#2167) --- internal/db/admin.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'internal/db/admin.go') diff --git a/internal/db/admin.go b/internal/db/admin.go index 717ac4b94..fcae928f6 100644 --- a/internal/db/admin.go +++ b/internal/db/admin.go @@ -49,4 +49,23 @@ type Admin interface { // Ie., if the instance is hosted at 'example.org' the instance will have a domain of 'example.org'. // This is needed for things like serving instance information through /api/v1/instance CreateInstanceInstance(ctx context.Context) error + + /* + ACTION FUNCS + */ + + // GetAdminAction returns the admin action with the given ID. + GetAdminAction(ctx context.Context, id string) (*gtsmodel.AdminAction, error) + + // GetAdminActions gets all admin actions from the database. + GetAdminActions(ctx context.Context) ([]*gtsmodel.AdminAction, error) + + // PutAdminAction puts one admin action in the database. + PutAdminAction(ctx context.Context, action *gtsmodel.AdminAction) error + + // UpdateAdminAction updates one admin action by its ID. + UpdateAdminAction(ctx context.Context, action *gtsmodel.AdminAction, columns ...string) error + + // DeleteAdminAction deletes admin action with the given ID. + DeleteAdminAction(ctx context.Context, id string) error } -- cgit v1.2.3