Skip to content

Commit

Permalink
docs/style: Replace an example that uses a stream name that should be…
Browse files Browse the repository at this point in the history
… an ID

The example was still valid for the point this section is making.
But there are lots of other examples to choose from, so pick one
that doesn't serve as a bad example in another respect.
  • Loading branch information
gnprice committed Mar 2, 2022
1 parent 6dccf2e commit ca5bbfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -654,20 +654,20 @@ import * as api from '../api';

//

api.subscriptionAdd(auth, [{ name: stream.name }]);
const response = await api.uploadFile(auth, url, name);

```

rather than like this:

```js
// BAD
import subscriptionAdd from '../api/subscriptions/subscriptionAdd';
import uploadFile from '../api/uploadFile.js;
// …
// BAD
subscriptionAdd(auth, [{ name: stream.name }]);
const response = await uploadFile(auth, url, name);
```
We do this because a lot of the names in our API bindings are also
Expand Down
1 change: 0 additions & 1 deletion src/api/subscriptions/subscriptionAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { apiPost } from '../apiFetch';
type SubscriptionObj = {|
// TODO(server-future): This should use a stream ID (#3918), not stream name.
// Server issue: https://github.com/zulip/zulip/issues/10744
// TODO(#3918): Change example in docs/style.md to something without this issue.
name: string,
|};

Expand Down

0 comments on commit ca5bbfc

Please sign in to comment.