Skip to content

Import snippets from JSON #8

Description

@byteofhoney

Goal:

Let users upload a JSON file to bulk add snippets back into the application.

User story:

As a user, I want to import snippets from a JSON file so that I can restore or migrate my stash.

Tasks

  • Add a new route, e.g. GET/POST /import, with a file upload form
  • Validate uploaded JSON matches expected snippet structure before inserting
  • Decide and document behavior for duplicates (skip / overwrite / insert as new)
  • Show a summary flash message after import (e.g. "12 snippets imported")
  • Add a visible "Import" button or link somewhere in the UI

Acceptance Criteria

  • Uploading a valid exported JSON file successfully re-creates those snippets
  • Invalid/malformed JSON shows a clear error instead of crashing
  • Duplicate handling behaves as documented in the PR

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions