Skip to content

Commit

Permalink
remove default anonymous field in topicsAPIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayla Lei committed Sep 29, 2024
1 parent b5cb7e6 commit 528f213
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/api/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ topicsAPI.get = async function (caller, data) {
return topic;
};

topicsAPI.create = async function (caller, data, anonymous = false) {
topicsAPI.create = async function (caller, data) {
if (!data) {
throw new Error('[[error:invalid-data]]');
}
data.anonymous = anonymous;

const payload = { ...data };
payload.tags = payload.tags || [];
Expand Down Expand Up @@ -84,11 +83,10 @@ topicsAPI.create = async function (caller, data, anonymous = false) {
return result.topicData;
};

topicsAPI.reply = async function (caller, data, anonymous = false) {
topicsAPI.reply = async function (caller, data) {
if (!data || !data.tid || (meta.config.minimumPostLength !== 0 && !data.content)) {
throw new Error('[[error:invalid-data]]');
}
data.anonymous = anonymous;
const payload = { ...data };
apiHelpers.setDefaultPostData(caller, payload);

Expand Down

0 comments on commit 528f213

Please sign in to comment.