0

Standardize endpoint name and fix doc. Closes #1966

This commit is contained in:
Gabe Kangas 2022-06-20 08:46:53 -07:00
parent 6ff8c89246
commit 3741196de6
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
4 changed files with 92 additions and 92 deletions

View File

@ -686,7 +686,7 @@ paths:
type: string
example: https://fediverse.biz/authorize_interaction?uri=https://my.owncast.server/federation/user/streamer
/api/chat/updatemessagevisibility:
/api/chat/messagevisibility:
post:
summary: Update the visibility of chat messages.
description: Pass an array of IDs you want to change the chat visibility of.
@ -951,7 +951,7 @@ paths:
type: string
format: date-time
/api/admin/chat/updatemessagevisibility:
/api/admin/chat/messagevisibility:
post:
summary: Update the visibility of chat messages.
description: Pass an array of IDs you want to change the chat visibility of.
@ -1984,7 +1984,7 @@ paths:
type: string
format: date-time
/api/integrations/chat/updatemessagevisibility:
/api/integrations/chat/messagevisibility:
post:
summary: Update the visibility of chat messages.
description: Pass an array of IDs you want to change the chat visibility of.

View File

@ -126,7 +126,7 @@ func Start() error {
http.HandleFunc("/api/admin/chat/messages", middleware.RequireAdminAuth(admin.GetChatMessages))
// Update chat message visibility
http.HandleFunc("/api/admin/chat/updatemessagevisibility", middleware.RequireAdminAuth(admin.UpdateMessageVisibility))
http.HandleFunc("/api/admin/chat/messagevisibility", middleware.RequireAdminAuth(admin.UpdateMessageVisibility))
// Enable/disable a user
http.HandleFunc("/api/admin/chat/users/setenabled", middleware.RequireAdminAuth(admin.UpdateUserEnabled))
@ -310,7 +310,7 @@ func Start() error {
// Inline chat moderation actions
// Update chat message visibility
http.HandleFunc("/api/chat/updatemessagevisibility", middleware.RequireUserModerationScopeAccesstoken(admin.UpdateMessageVisibility))
http.HandleFunc("/api/chat/messagevisibility", middleware.RequireUserModerationScopeAccesstoken(admin.UpdateMessageVisibility))
// Enable/disable a user
http.HandleFunc("/api/chat/users/setenabled", middleware.RequireUserModerationScopeAccesstoken(admin.UpdateUserEnabled))

View File

@ -56,7 +56,7 @@ test('verify we can make API call to mark message as hidden', async (done) => {
const message = res.body[0];
messageId = message.id;
await request
.post('/api/admin/chat/updatemessagevisibility')
.post('/api/admin/chat/messagevisibility')
.auth('admin', 'abc123')
.send({ idArray: [messageId], visible: false })
.expect(200);

View File

@ -7,7 +7,7 @@ export const URL_CONFIG = `/api/config`;
export const URL_VIEWER_PING = `/api/ping`;
// inline moderation actions
export const URL_HIDE_MESSAGE = `/api/chat/updatemessagevisibility`;
export const URL_HIDE_MESSAGE = `/api/chat/messagevisibility`;
export const URL_BAN_USER = `/api/chat/users/setenabled`;
// TODO: This directory is customizable in the config. So we should expose this via the config API.