Skip to content

fix: remove all as any casts from useProofSubmit.ts - #121

Open
smartalee wants to merge 1 commit into
ecotask-network:mainfrom
smartalee:feature/remove-as-any-casts
Open

fix: remove all as any casts from useProofSubmit.ts#121
smartalee wants to merge 1 commit into
ecotask-network:mainfrom
smartalee:feature/remove-as-any-casts

Conversation

@smartalee

Copy link
Copy Markdown

Closes #63

What This Does

Removes all as any casts from useProofSubmit.ts and improves type safety.

Changes

  • Added ReactNativeFile type for FormData photo field
  • Added isProofUploadError type guard
  • Added isReactNativeFile type guard
  • Replaced error mutation with proper Error object creation
  • Removed all as any casts
  • PendingProof type already has lat, lng, photoCid, metadataCid

Files Changed

  • src/hooks/useProofSubmit.ts

Acceptance Criteria

  • No as any casts in useProofSubmit.ts
  • ProofSubmitError class for error augmentation
  • PendingProof type includes all required fields
  • FormData photo append is properly typed
  • All property accesses are type-checked

- Add proper ReactNativeFile type for FormData
- Add type guards for error handling
- Create new Error objects instead of mutating existing ones
- Remove all as any casts
- PendingProof type already has all required fields

Closes ecotask-network#63

@cybermax4200 cybermax4200 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix workflow

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pervasive as any casts in proof submission and API parameter handling

2 participants