parent
c865897673
commit
08ef869ea3
@ -1,17 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { trpc } from '~/utils/trpc';
|
|
||||||
|
|
||||||
function GenerateAnalysis() {
|
|
||||||
const analysisMutation = trpc.useMutation(['offers.analysis.generate']);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
{JSON.stringify(
|
|
||||||
analysisMutation.mutate({ profileId: 'cl9lwe9m902k5utskjs52wc0j' }),
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default GenerateAnalysis;
|
|
@ -1,14 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { trpc } from '~/utils/trpc';
|
|
||||||
|
|
||||||
function GetAnalysis() {
|
|
||||||
const analysis = trpc.useQuery([
|
|
||||||
'offers.analysis.get',
|
|
||||||
{ profileId: 'cl9lwe9m902k5utskjs52wc0j' },
|
|
||||||
]);
|
|
||||||
|
|
||||||
return <div>{JSON.stringify(analysis.data)}</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default GetAnalysis;
|
|
@ -1,53 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { trpc } from '~/utils/trpc';
|
|
||||||
|
|
||||||
function Test() {
|
|
||||||
const data = trpc.useQuery([
|
|
||||||
'offers.list',
|
|
||||||
{
|
|
||||||
currency: 'SGD',
|
|
||||||
limit: 100,
|
|
||||||
location: 'Singapore, Singapore',
|
|
||||||
offset: 0,
|
|
||||||
sortBy: '-totalCompensation',
|
|
||||||
yoeCategory: 1,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const deleteMutation = trpc.useMutation(['offers.profile.delete']);
|
|
||||||
|
|
||||||
const handleDelete = (id: string) => {
|
|
||||||
deleteMutation.mutate({ profileId: id, token: ' dadaadad' });
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<b>{JSON.stringify(data.data?.paging)}</b>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<ul>
|
|
||||||
{data.data?.data.map((offer) => {
|
|
||||||
return (
|
|
||||||
<li key={offer.id}>
|
|
||||||
<button
|
|
||||||
className="text-danger-600"
|
|
||||||
type="button"
|
|
||||||
onClick={() => {
|
|
||||||
handleDelete(offer.profileId);
|
|
||||||
}}>
|
|
||||||
DELETE THIS PROFILE AND ALL ITS OFFERS
|
|
||||||
</button>
|
|
||||||
<div>{JSON.stringify(offer)}</div>
|
|
||||||
<br />
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Test;
|
|
Loading…
Reference in new issue