كيفية استخدام مهمة ريك المخصصة 'undo change timestamp'؟

شكراً لك، سأجرب ذلك لاحقاً.

لقد جربت طريقة الـ API للتو.

ولكنني أحصل على خطأ 400، يقول:

{ errors: [ 'param is missing or the value is empty: timestamp' ] }

هذا هو الكود الخاص بي:

changeTimestamp(935, 1694291380);

async function changeTimestamp(topicId, timestamp) {
  const endpoint = `/t/${topicId}/change-timestamp`;
  const payload = {
    timestamp: timestamp,
  };
  put(endpoint, payload);
}

async function put(endpoint, payload) {
  const response = await fetch(DISCOURSE_ADDRESS + endpoint, {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
      "Api-Key": DISCOURSE_API_KEY,
      "Api-Username": API_USERNAME,
      body: JSON.stringify(payload),
    },
  });
  const result = await response.json();
  if (!response.ok) {
    console.log("put failed");
    console.log(result);
  } else {
    console.log("put success");
  }
}