<script setup lang="ts">
import { apiBase } from '~/helpers';
import type { ApiTypeList } from '~/helpers';

const headers = new Headers();
headers.append("Content-Type", "application/json");

const { data } = await useFetch<ApiTypeList>(`${apiBase}/partner/`, { headers })
</script>
<template>
    <div class="mb-4">
        <UButton icon="i-heroicons-plus" to="/organization/new">Новая инвентаризация</UButton>
    </div>
    <div class="mb-4">
        <UTable :rows="data?.results">
            <template #external_id-data="{ row }">
                <NuxtLink :to="`/organization/p_${row.id}`">{{ row.external_id }}</NuxtLink>
            </template>
        </UTable>
    </div>
</template>