Skip to content

Commit

Permalink
fix: author id is missing from metadata extraction automation
Browse files Browse the repository at this point in the history
  • Loading branch information
shadrach-tayo committed Oct 30, 2024
1 parent 84550d5 commit 9090b9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions desci-server/src/controllers/nodes/doi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { NextFunction, Response } from 'express';
import { Request } from 'express';
import _ from 'lodash';
import { v4 as uuidv4 } from 'uuid';
import { z } from 'zod';

import { BadRequestError, NotFoundError, UnProcessableRequestError } from '../../core/ApiError.js';
Expand Down Expand Up @@ -182,6 +183,7 @@ export const automateManuscriptDoi = async (req: RequestWithNode, res: Response,
actions.push({
type: 'Set Contributors',
contributors: authors.map((author) => ({
id: uuidv4(),
name: author.name,
role: ResearchObjectV1AuthorRole.AUTHOR,
...(author.affiliations.length > 0 && { organizations: author.affiliations }),
Expand Down
2 changes: 2 additions & 0 deletions desci-server/src/services/AutomatedMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { DocumentId } from '@automerge/automerge-repo';
import { ManifestActions, ResearchObjectV1Author, ResearchObjectV1AuthorRole } from '@desci-labs/desci-models';
import axios from 'axios';
import FormData from 'form-data';
import { v4 as uuidv4 } from 'uuid';

import { logger as parentLogger } from '../logger.js';
import { ONE_DAY_TTL, getFromCache, setToCache } from '../redisClient.js';
Expand Down Expand Up @@ -314,6 +315,7 @@ export class AutomatedMetadataClient {
contributors: metadata.authors.map(
(author) =>
({
id: uuidv4(),
name: author.name,
role: ResearchObjectV1AuthorRole.AUTHOR,
...(author.affiliations.length > 0 && { organizations: author.affiliations }),
Expand Down

0 comments on commit 9090b9b

Please sign in to comment.