import api from '../lib/oo-api' import {OOAPIResult} from '../type/oo-api' import {OOExtension} from '../type/oo-extension' import {OOProject} from '../type/oo-project' interface ProjectOptionsPost { uid: string, approve?: boolean, title?: string, body?: string, tags?: Array } export default async (options: ProjectOptionsPost): Promise> => { const {uid, approve, title, body, tags} = options const extensions: Array = [] if (approve !== undefined) { extensions.push({ key: 'approve', value: approve }) } if (title) { extensions.push({ key: 'title', value: title }) } if (body) { extensions.push({ key: 'body', value: body }) } if (tags) { extensions.push({ key: 'tags', value: tags }) } const ooapiRes = await api({ resource: 'projects', pathParameter: uid, method: 'PATCH', body: { Extensions: extensions } }) return ooapiRes }