Initial cut - untested.

This commit is contained in:
2025-09-25 09:31:02 -07:00
parent 7a0666cc6c
commit 3775522265
33 changed files with 351 additions and 346 deletions

View File

@@ -30,13 +30,13 @@ const SiteEditor = ({value, close}) => {
const [name, setName] = useState(value.name || "")
const [externalId, setExternalId] = useState(value.externalId || "")
const applyChanges = () => {
const applyChanges = async () => {
close()
//TODO Should invert this and only close if there was success on the server.
if(value._id)
Meteor.call("sites.update", value._id, name, externalId);
await Meteor.callAsync("sites.update", value._id, name, externalId);
else
Meteor.call("sites.add", name, externalId);
await Meteor.callAsync("sites.add", name, externalId);
}
const rejectChanges = () => {
close()
@@ -58,8 +58,8 @@ const SiteEditor = ({value, close}) => {
export default () => {
Meteor.subscribe('sites');
const {sites} = useTracker(() => {
const sites = Sites.find({}).fetch();
const {sites} = useTracker(async () => {
const sites = await Sites.find({}).fetchAsync();
return {
sites
}