editnote

package
v1.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(db bun.IDB) http.HandlerFunc

Handler changes the fields given: PATCH /api/notes/{id}, through patchnote (shared with `edit note`). It answers the note as GET does, so the app needs no second request after a save. @Summary Change the fields given @Tags notes @Accept json @Produce json @Param id path string true "uuid" @Param body body Body true "body" @Success 200 {object} readitem.Result @Failure 400 {object} respond.Failure @Failure 404 {object} respond.Failure @Failure 409 {object} respond.Failure @Failure 413 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/notes/{id} [patch]

Types

type Body

type Body struct {
	Pinned   *bool     `json:"pinned" binding:"optional"`
	Readonly *bool     `json:"readonly" binding:"optional"`
	Content  *string   `json:"content" binding:"optional"`
	Tags     *[]string `json:"tags" binding:"optional"`
	// UpdatedAt is updated_at as read, or created_at for a note never edited: a 409 if the note changed since.
	UpdatedAt *time.Time `json:"updated_at" binding:"optional"`
	// Restore says the content is a version restored: the text it replaces is kept in the history.
	Restore bool `json:"restore,omitempty" binding:"optional"`
}

Body is patchnote.Input in JSON: a field left out is kept.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL