Skip to content

Commit

Permalink
Merge pull request #8788 from hicommonwealth/tim/topics-fix
Browse files Browse the repository at this point in the history
Bug Fix
  • Loading branch information
jnaviask authored Aug 7, 2024
2 parents 89e556e + bf6ad62 commit 3be8ea7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function __createTopic(
true,
);

const isAdmin = validateOwner({
const isAdmin = await validateOwner({
models: this.models,
user,
// @ts-expect-error StrictNullChecks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function __deleteTopic(
throw new AppError(Errors.TopicNotFound);
}

const isAdmin = validateOwner({
const isAdmin = await validateOwner({
models: this.models,
user,
communityId: topic.community_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const createMockedTopicsController = (isAdmin: boolean = false) => {

describe('ServerTopicsController', () => {
test('#createTopic', async () => {
const { controller, user, chain } = createMockedTopicsController();
const { controller, user, chain } = createMockedTopicsController(true);
const [topic] = await Promise.all(
await controller.createTopic({
user,
Expand All @@ -99,7 +99,7 @@ describe('ServerTopicsController', () => {
});

test('#deleteTopic', async () => {
const { controller, user } = createMockedTopicsController();
const { controller, user } = createMockedTopicsController(true);
await controller.deleteTopic({
user,
topicId: 1,
Expand Down

0 comments on commit 3be8ea7

Please sign in to comment.