mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
API so that you don't have to use a global variable for pretender
This commit is contained in:
@ -20,7 +20,7 @@ export function parsePostData(query) {
|
||||
return result;
|
||||
};
|
||||
|
||||
function response(code, obj) {
|
||||
export function response(code, obj) {
|
||||
if (typeof code === "object") {
|
||||
obj = code;
|
||||
code = 200;
|
||||
@ -28,7 +28,10 @@ function response(code, obj) {
|
||||
return [code, {"Content-Type": "application/json"}, obj];
|
||||
}
|
||||
|
||||
const success = () => response({ success: true });
|
||||
export function success() {
|
||||
return response({ success: true });
|
||||
}
|
||||
|
||||
const loggedIn = () => !!Discourse.User.current();
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user