Commit d3235f75 authored by Steven's avatar Steven

chore: tweak memo definition

parent e0600388
......@@ -903,15 +903,9 @@ paths:
type: string
pinned:
type: boolean
property:
$ref: '#/definitions/v1MemoProperty'
readOnly: true
parent:
type: string
description: |-
The name of the parent memo.
Format: memos/{id}
id is the system generated id.
parentId:
type: integer
format: int32
readOnly: true
resources:
type: array
......@@ -931,6 +925,15 @@ paths:
type: object
$ref: '#/definitions/v1Reaction'
readOnly: true
property:
$ref: '#/definitions/v1MemoProperty'
readOnly: true
parent:
type: string
title: |-
The name of the parent memo.
Format: memos/{id}
readOnly: true
tags:
- MemoService
/api/v1/{name_1}:
......@@ -2658,15 +2661,9 @@ definitions:
type: string
pinned:
type: boolean
property:
$ref: '#/definitions/v1MemoProperty'
readOnly: true
parent:
type: string
description: |-
The name of the parent memo.
Format: memos/{id}
id is the system generated id.
parentId:
type: integer
format: int32
readOnly: true
resources:
type: array
......@@ -2686,6 +2683,15 @@ definitions:
type: object
$ref: '#/definitions/v1Reaction'
readOnly: true
property:
$ref: '#/definitions/v1MemoProperty'
readOnly: true
parent:
type: string
title: |-
The name of the parent memo.
Format: memos/{id}
readOnly: true
v1MemoProperty:
type: object
properties:
......
......@@ -185,18 +185,22 @@ message Memo {
bool pinned = 12;
MemoProperty property = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
optional int32 parent_id = 13 [
deprecated = true,
(google.api.field_behavior) = OUTPUT_ONLY
];
// The name of the parent memo.
// Format: memos/{id}
// id is the system generated id.
optional string parent = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated Resource resources = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated Resource resources = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated MemoRelation relations = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated MemoRelation relations = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated Reaction reactions = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated Reaction reactions = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
MemoProperty property = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
// The name of the parent memo.
// Format: memos/{id}
optional string parent = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
}
message MemoProperty {
......
This diff is collapsed.
......@@ -797,6 +797,7 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem
memoMessage.Property = convertMemoPropertyFromStore(memo.Payload.Property)
}
if memo.ParentID != nil {
memoMessage.ParentId = memo.ParentID
parent := fmt.Sprintf("%s%d", MemoNamePrefix, *memo.ParentID)
memoMessage.Parent = &parent
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment