Skip to content

Commit

Permalink
pass user on post collection
Browse files Browse the repository at this point in the history
  • Loading branch information
rucsi committed Jan 25, 2024
1 parent 6efa866 commit 5744567
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/web/src/components/editorial/collections.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useMemo, useState } from 'react'
import { Link, useNavigate, useLocation } from 'react-router-dom'
import { useAuth } from '../../lib/auth'
import { useClient, endpoints } from '../../lib/moonbase'
import Error from '../error'
import Loader from '../loader'
Expand All @@ -15,6 +16,7 @@ function useQuery() {
export default ({ owner, repo, branch }) => {
let query = useQuery();
const client = useClient()
const { user } = useAuth()
const navigate = useNavigate()
const [addNew, setAddNew] = useState(false)
const [collections, setCollections] = useState(null)
Expand Down Expand Up @@ -51,7 +53,7 @@ export default ({ owner, repo, branch }) => {
if (!name)
return setAddNew(false)

client.post(endpoints.collections(owner, repo, branch), { name }).then(data => {
client.post(endpoints.collections(owner, repo, branch), { login: user.login, name }).then(data => {
if (data.error) {
return setError(data.error)
}
Expand Down

0 comments on commit 5744567

Please sign in to comment.