Open-source and local-first Slack and Notion alternative that puts you in control of your data
TypeScript chatchat-applicationcrdteditorelectronknowledge-baselocal-firstnotionnotion-alternativerealtime-collaborationself-hostedslacksqliteteam-collaborationwikiyjs
import { WorkspaceMutationHandlerBase } from '@colanode/client/handlers/mutations/workspace-mutation-handler-base';
import { MutationHandler } from '@colanode/client/lib/types';
import {
FileDownloadMutationInput,
FileDownloadMutationOutput,
} from '@colanode/client/mutations';
export class FileDownloadMutationHandler
extends WorkspaceMutationHandlerBase
implements MutationHandler<FileDownloadMutationInput>
{
async handleMutation(
input: FileDownloadMutationInput
): Promise<FileDownloadMutationOutput> {
const workspace = this.getWorkspace(input.userId);
const path = input.path;
const manualDownload = await workspace.files.initManualDownload(
input.fileId,
path
);
return {
success: !!manualDownload,
};
}
}