mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 01:07:14 +00:00
fix: use ok:true wrapper for emojiList consistent with other actions
This commit is contained in:
committed by
Peter Steinberger
parent
36ec13a593
commit
475299346a
@@ -312,18 +312,17 @@ export async function handleSlackAction(
|
||||
throw new Error("Slack emoji list is disabled.");
|
||||
}
|
||||
const result = readOpts ? await listSlackEmojis(readOpts) : await listSlackEmojis();
|
||||
const ok = result.ok ?? false;
|
||||
const limit = readNumberParam(params, "limit", { integer: true });
|
||||
if (limit != null && limit > 0 && result.emoji != null) {
|
||||
const entries = Object.entries(result.emoji).toSorted(([a], [b]) => a.localeCompare(b));
|
||||
if (entries.length > limit) {
|
||||
return jsonResult({
|
||||
ok,
|
||||
ok: true,
|
||||
emojis: { ...result, emoji: Object.fromEntries(entries.slice(0, limit)) },
|
||||
});
|
||||
}
|
||||
}
|
||||
return jsonResult({ ok, emojis: result });
|
||||
return jsonResult({ ok: true, emojis: result });
|
||||
}
|
||||
|
||||
throw new Error(`Unknown action: ${action}`);
|
||||
|
||||
Reference in New Issue
Block a user