add send .ics as calendar invite

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-06-06 09:26:52 +02:00
parent b1bace4cce
commit 432d3d2c74
10 changed files with 156 additions and 23 deletions
+7
View File
@@ -33,6 +33,7 @@ var AttachmentColumnsMap = map[string]string{
"name": repository.TableColumn(database.ATTACHMENT_TABLE, "name"),
"description": repository.TableColumn(database.ATTACHMENT_TABLE, "description"),
"embedded content": repository.TableColumn(database.ATTACHMENT_TABLE, "embeddedContent"),
"send as calendar": repository.TableColumn(database.ATTACHMENT_TABLE, "sendAsCalendar"),
"filename": repository.TableColumn(database.ATTACHMENT_TABLE, "filename"),
}
@@ -255,6 +256,11 @@ func (a *Attachment) Create(g *gin.Context) {
if strings.ToLower(embeddedContentString) == "true" {
embeddedContent.Set(true)
}
sendAsCalendar := nullable.NewNullableWithValue(false)
sendAsCalendarString := g.PostForm("sendAsCalendar")
if strings.ToLower(sendAsCalendarString) == "true" {
sendAsCalendar.Set(true)
}
attachments := []*model.Attachment{}
for _, file := range multipartData.File["files"] {
// TODO multi user validate that the company id is the same as the session company id or that the session is a super admin
@@ -297,6 +303,7 @@ func (a *Attachment) Create(g *gin.Context) {
Name: name,
Description: description,
EmbeddedContent: embeddedContent,
SendAsCalendar: sendAsCalendar,
File: file,
FileName: fileName,
}