fix(react): Fetch userUrn from cookie while uploading documentation links (#2473)

2471 | Fetch userUrn from cookie while uploading document
This commit is contained in:
Lal Rishav 2021-05-01 09:48:20 +05:30 committed by GitHub
parent 9f4de4b20a
commit 0653edc9b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,10 @@
import { Button, Form, Input, Space, Table, Typography } from 'antd';
import React, { useEffect, useMemo, useState } from 'react';
import { Link } from 'react-router-dom';
import Cookies from 'js-cookie';
import { EntityType, InstitutionalMemoryMetadata, InstitutionalMemoryUpdate } from '../../../../types.generated';
import { useEntityRegistry } from '../../../useEntityRegistry';
import { GlobalCfg } from '../../../../conf';
export type Props = {
documents: Array<InstitutionalMemoryMetadata>;
@ -70,7 +72,7 @@ export default function Documentation({ documents, updateDocumentation }: Props)
const newDoc = {
url: '',
description: '',
author: localStorage.getItem('userUrn') as string,
author: Cookies.get(GlobalCfg.CLIENT_AUTH_COOKIE) as string,
created: {
time: Date.now(),
},