Server logic for the updateProject sub-module that handles artwork purchase link management. Updates print store URLs and OpenSea NFT links, respecting demo mode by blocking write operations. Parses OpenSea URLs to extract chain, contract address, and token ID.
Arguments
- id
Character scalar. Shiny namespace ID for the module. Used by [shiny::NS()] to create unique element IDs and prevent conflicts with other modules or the parent app. Must match between UI and server calls.
- r
Reactive list from parent application. Must contain:
- `r$artist`
Character. Artist UUID (format: `"746bxxxx-..."`).
- `r$artwork`
Character. Current artwork UUID (format: `"99xxxxxx-..."`), if any.
- `r$appdata`
List. Complete artist context from [artutils::get_appdata()]. Contains `r$appdata$artist$artDT` (data.table of artworks), `r$appdata$artist$collections` (named list of collection UUIDs), and `r$appdata$artist$info` (artist metadata).
- r_proj_id
Reactive value (integer). Row index in `r$appdata$artist$artDT` for the artwork being edited. Set by parent when user clicks edit button.
Value
The `r` reactive list (unchanged). Side effects only - updates database records in `app.artwork_print` and `app.artwork_opensea`.
See also
* [updateProjectUI()] for UI function * [modUploadServer()] for parent integration * [artutils::get_artist_opensea()] for OpenSea data
Other ui-modules:
updateProjectUI()
Examples
if (FALSE) { # \dontrun{
r_proj_id <- reactiveVal()
updateProjectServer("update", r, r_proj_id)
observeEvent(input$edit, {
r_proj_id(which(r$appdata$artist$artDT$art_name == name))
})
} # }
