Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Plan Sharing] Create or reuse an owner share ID

Aperta
#852 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
data

Direzione di ricerca

Read src/hooks/data/useSavedPlans.ts as the pattern for data hooks, then create src/hooks/data/usePlanSharing.ts exposing createShare(plan). The issue depends on #803 adding a nullable unique shareId column, so confirm that has landed before starting. Done means src/hooks/data/usePlanSharing.test.ts shows that two calls on an already-shared plan return the same /share/ URL and that signed-out calls fail with a readable message; run the test, pnpm lint and pnpm typecheck.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

sharing

What to build

Create a sharing identifier for a plan owned by the signed-in student. Reusing an existing identifier should keep the current shared link working rather than producing a new link every time.

Files

  • src/hooks/data/usePlanSharing.ts (new file)
  • Starting example: src/hooks/data/useSavedPlans.ts
    Code to add or extend: usePlanSharing().createShare(plan): Promise<string>.

Steps

  1. For a signed-in owner, use existing shareId if set; otherwise generate crypto.randomUUID and update own plan row by id/userId.
  2. Return ${window.location.origin}/share/${shareId} and invalidate the affected plan cache.
  3. Signed-out calls yield a readable sign-in requirement; never write someone else’s id.

Example

Two create calls for same already-shared plan return the same URL.

Check it works

In src/hooks/data/usePlanSharing.test.ts, check the example above and the failure or limit described in the steps. Run pnpm test -- src/hooks/data/usePlanSharing.test.ts, pnpm lint and pnpm typecheck.

Before starting

  • #803 — Add nullable unique shareId to saved plans

References

Assign yourself before starting, or comment to claim the issue. Project setup.

Lingua principale
TypeScript
Stelle
19
Fork
94
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DevDogsUGA/DogDays

Tutte le issue di DevDogsUGA/DogDays

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.