Skip to content

Conversation

@rosalieper
Copy link
Contributor

Bug: T410395

@rosalieper rosalieper changed the title [WIP]: Make API Endpoint to set the ReadOnly status of a Wiki Make API Endpoint to set the ReadOnly status of a Wiki Nov 24, 2025

if (!$wiki) {
return response()->json([
'error' => 'Wiki not found for domain: ' . $domain,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'error' => 'Wiki not found for domain: ' . $domain,
'error' => "Wiki not found for domain: $domain",

Non-blocking nitpick: let's make use of string interpolation :)

Comment on lines 12 to 14
$validated = $request->validate([
'domain' => 'required|string',
]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the task, this endpoint should also take a boolean readOnly parameter

], 404);
}

$wiki->setSetting('wgReadOnly', 'This wiki is currently read-only.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, this doesn't handle when the readOnly parameter is false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants