Skip to content

Commit

Permalink
fix: unable to update memo
Browse files Browse the repository at this point in the history
  • Loading branch information
mudkipme committed Jun 15, 2024
1 parent 7839d55 commit 364a0cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Packages/Services/Sources/MemosV1Service/MemosV1Service.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public final class MemosV1Service: RemoteService {
}

public func updateMemo(remoteId: String, content: String?, resources: [Resource]?, visibility: MemoVisibility?, tags: [String]?, pinned: Bool?) async throws -> Memo {
let resp = try await client.MemoService_UpdateMemo(path: .init(memo_period_name: getName(remoteId: remoteId)), body: .json(.init(
let resp = try await client.MemoService_UpdateMemo(path: .init(memo_name: getName(remoteId: remoteId)), body: .json(.init(
content: content,
visibility: visibility.map(MemosV1Visibility.init(memoVisibility:)),
pinned: pinned
Expand All @@ -122,12 +122,12 @@ public final class MemosV1Service: RemoteService {
}

public func archiveMemo(remoteId: String) async throws {
let resp = try await client.MemoService_UpdateMemo(path: .init(memo_period_name: getName(remoteId: remoteId)), body: .json(.init(rowStatus: .ARCHIVED)))
let resp = try await client.MemoService_UpdateMemo(path: .init(memo_name: getName(remoteId: remoteId)), body: .json(.init(rowStatus: .ARCHIVED)))
_ = try resp.ok
}

public func restoreMemo(remoteId: String) async throws {
let resp = try await client.MemoService_UpdateMemo(path: .init(memo_period_name: getName(remoteId: remoteId)), body: .json(.init(rowStatus: .ACTIVE)))
let resp = try await client.MemoService_UpdateMemo(path: .init(memo_name: getName(remoteId: remoteId)), body: .json(.init(rowStatus: .ACTIVE)))
_ = try resp.ok
}

Expand Down
4 changes: 2 additions & 2 deletions Packages/Services/Sources/MemosV1Service/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -995,14 +995,14 @@ paths:
schema:
$ref: '#/components/schemas/googlerpcStatus'
x-codegen-request-body-name: inbox
/api/v1/{memo.name}:
/api/v1/{memo_name}:
patch:
tags:
- MemoService
summary: UpdateMemo updates a memo.
operationId: MemoService_UpdateMemo
parameters:
- name: memo.name
- name: memo_name
in: path
description: |-
The name of the memo.
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Moe Memos

*To use this app, you must have a self-hosted [✍️memos](https://github.com/usememos/memos) server set up and running.*

**Moe Memos currently only supports Memos 0.21.0, as Memos 0.22.0 introduced major API-breaking changes and requires a lot of work to support. Please use the `0.21.0` Docker tag if you are using Moe Memos for now.**

## Installation

[![Download Moe Memos on the App Store](https://memos.moe/app-store-badge.svg)](https://apps.apple.com/app/moe-memos/id1643902185)
Expand All @@ -29,9 +27,7 @@ Moe Memos is available on App Store for free. You can also build this app with X
- Available on iPhone and iPad with multitasking support
- Full privacy protection, no data collection

## About

Moe Memos is a third-party client for [✍️memos](https://github.com/usememos/memos) and both projects aren't affiliated with each other. Both projects are inspired by the memo-taking tool [flomo](https://flomoapp.com/). If you prefer an all-in-one alternative syncing with the cloud, it is recommended to try [flomo](https://flomoapp.com/).
Moe Memos is a third-party client for [✍️memos](https://github.com/usememos/memos) and both projects aren't affiliated with each other.

## Development

Expand Down

0 comments on commit 364a0cb

Please sign in to comment.