1- import { Material_Type , User , Assembly , Material_Status } from '@prisma/client' ;
1+ import { Material_Type , User , Assembly , Material_Status , Material } from '@prisma/client' ;
22import { isAdmin , isGuest , isLeadership , isProject , LinkCreateArgs , LinkType , Project , WbsNumber , wbsPipe } from 'shared' ;
33import projectQueryArgs from '../prisma-query-args/projects.query-args' ;
44import prisma from '../prisma/prisma' ;
@@ -609,20 +609,20 @@ export default class ProjectsService {
609609 * Creates a new Material
610610 * @param creator the user creating the material
611611 * @param name the name of the material
612- * @param assemblyId the id of the Assembly for the material
613612 * @param status the Material Status of the material
614613 * @param materialTypeName the name of the Material Type
615614 * @param manufacturerName the name of the material's manufacturer
616615 * @param manufacturerPartNumber the manufacturer part number for the material
617- * @param pdmFileName the name of the pdm file for the material
618616 * @param quantity the quantity of material as a number
619617 * @param unitName the name of the Quantity Unit the quantity is measured in
620618 * @param price the price of the material in whole cents
621619 * @param subtotal the subtotal of the price for the material in whole cents
622620 * @param linkUrl the url for the material's link as a string
623621 * @param notes any notes about the material as a string
624622 * @param wbsNumber the WBS number of the project associated with this material
625- * @returns the id of the created material
623+ * @param assemblyId the id of the Assembly for the material
624+ * @param pdmFileName the name of the pdm file for the material
625+ * @returns the created material
626626 */
627627 static async createMaterial (
628628 creator : User ,
@@ -640,7 +640,7 @@ export default class ProjectsService {
640640 wbsNumber : WbsNumber ,
641641 assemblyId ?: string ,
642642 pdmFileName ?: string
643- ) : Promise < string > {
643+ ) : Promise < Material > {
644644 const project = await prisma . project . findFirst ( {
645645 where : {
646646 wbsElement : {
@@ -699,7 +699,7 @@ export default class ProjectsService {
699699 }
700700 } ) ;
701701
702- return createdMaterial . materialId ;
702+ return createdMaterial ;
703703 }
704704
705705 /**
0 commit comments