mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: create memo with resource name
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/lithammer/shortuuid/v4"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
@@ -894,10 +895,11 @@ func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store
|
|||||||
createdTs = *memoCreate.CreatedTs
|
createdTs = *memoCreate.CreatedTs
|
||||||
}
|
}
|
||||||
return &store.Memo{
|
return &store.Memo{
|
||||||
CreatorID: memoCreate.CreatorID,
|
ResourceName: shortuuid.New(),
|
||||||
CreatedTs: createdTs,
|
CreatorID: memoCreate.CreatorID,
|
||||||
Content: memoCreate.Content,
|
CreatedTs: createdTs,
|
||||||
Visibility: store.Visibility(memoCreate.Visibility),
|
Content: memoCreate.Content,
|
||||||
|
Visibility: store.Visibility(memoCreate.Visibility),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"unicode/utf16"
|
"unicode/utf16"
|
||||||
|
|
||||||
|
"github.com/lithammer/shortuuid/v4"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
apiv1 "github.com/usememos/memos/api/v1"
|
apiv1 "github.com/usememos/memos/api/v1"
|
||||||
@@ -58,8 +59,9 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot,
|
|||||||
}
|
}
|
||||||
|
|
||||||
create := &store.Memo{
|
create := &store.Memo{
|
||||||
CreatorID: creatorID,
|
ResourceName: shortuuid.New(),
|
||||||
Visibility: store.Private,
|
CreatorID: creatorID,
|
||||||
|
Visibility: store.Private,
|
||||||
}
|
}
|
||||||
|
|
||||||
if message.Text != nil {
|
if message.Text != nil {
|
||||||
|
Reference in New Issue
Block a user