function linkAttachments
linkAttachments(
text: string,
resourceType: AttachmentResourceType,
resourceId: string
): void

Binds the attachments whose URLs appear in text to the resource that saved it, so the startup purge keeps them as long as that resource exists, and they are seen by whoever may see it. It is called whenever a dump, comment, chat message, playlist or profile description is saved. An attachment already bound stays with its resource, so pasting another's URL claims nothing, and removing the link from a body never unbinds it.

Parameters

text: string
resourceId: string

Return Type

void

Usage

import { linkAttachments } from "api/services/attachment-service.ts";