Skip to content

Guard decide() against empty approval ids #4

Description

@royalpinto007

Problem

decide() POSTs {id: approval.id, ...} to /api/approve with no empty-string check, sending meaningless approve/deny calls.

Where

lib/api.ts (decide, no id guard before fetch).

Acceptance

Add a failing test first calling decide({id: "", ...}, true), expecting false without calling fetch. Then fix.

Note: this repo has no test runner configured yet. Setting up a minimal vitest (or equivalent) config is part of this issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions