Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Feb 19, 2024
1 parent 01af151 commit cf56ce7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions MyApp.Client/src/pages/bookings-auto.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="pb-20">
<h4 class="mt-20 text-center text-xl">
Manage Bookings in
<a class="font-semibold" :href="apiUrl('/admin/#Bookings')">Admin</a>,
<RouterLink class="font-semibold" to="/admin/bookings">Admin</RouterLink>,
<a class="font-semibold" :href="apiUrl('/locode/QueryBookings')">Locode</a> or
<a class="font-semibold" :href="apiUrl('/ui/QueryBookings')">API Explorer</a>
</h4>
Expand All @@ -72,10 +72,10 @@
<RouterLink class="font-semibold" to="https://docs.servicestack.net/autoquery-crud">AutoQuery CRUD</RouterLink>,
allowing for rapid development of typed CRUD Services using only declarative POCO DTOs, enabling
developing entire
<RouterLink class="font-semibold" to="https://docs.servicestack.net/autoquery-crud#advanced-crud-example">audited</RouterLink>
&amp; <RouterLink class="font-semibold" to="https://docs.servicestack.net/autoquery-audit-log">verifiable</RouterLink>
<RouterLink class="font-semibold" to="https://docs.servicestack.net/autoquery/crud#advanced-crud-example">audited</RouterLink>
&amp; <RouterLink class="font-semibold" to="https://docs.servicestack.net/autoquery/audit-log">verifiable</RouterLink>
data-driven systems in mins
<RouterLink class="font-semibold" to="https://docs.servicestack.net/autoquery-crud-bookings">more...</RouterLink>
<RouterLink class="font-semibold" to="https://docs.servicestack.net/autoquery/bookings-crud">more...</RouterLink>
</p>
<iframe class="mt-4 w-full aspect-video" src="https://www.youtube.com/embed/rSFiikDjGos" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
Expand Down
3 changes: 2 additions & 1 deletion MyApp.Client/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ export const formatCurrency = (n?:number) => n ? formatter.format(n) : ''
export const formatDate = (s?:string) => s ? toDateFmt(s) : ''

export const dateInputFormat = (d:Date) => dateFmt(d).replace(/\//g,'-')
const isoDateRegex = /^\d{2,4}-\d{1,2}-\d{1,2}T\d{1,2}:\d{1,2}:\d{1,2}/

export function sanitizeForUi(dto:any) {
if (!dto) return {}
Object.keys(dto).forEach(key => {
let value = dto[key]
if (typeof value == 'string') {
if (value.startsWith('/Date'))
if (value.startsWith('/Date') || value.match(isoDateRegex))
dto[key] = dateInputFormat(toDate(value))
}
})
Expand Down
3 changes: 2 additions & 1 deletion MyApp.Client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) {

const target = env.ASPNETCORE_HTTPS_PORT ? `https://localhost:${env.ASPNETCORE_HTTPS_PORT}` :
env.ASPNETCORE_URLS ? env.ASPNETCORE_URLS.split(';')[0] : 'https://localhost:5001';
const apiUrl = process.env.NODE_ENV === 'development' ? target : ''
const baseUrl = process.env.NODE_ENV === 'development'
? "https://locahost:5173"
: process.env.DEPLOY_HOST ? `https://${process.env.DEPLOY_HOST}` : undefined
Expand Down Expand Up @@ -114,7 +115,7 @@ export function configureMarkdown(md:MarkdownIt) {

// https://vitejs.dev/config/
export default defineConfig({
define: { API_URL: `"${target}"` },
define: { API_URL: `"${apiUrl}"` },
plugins: [
// https://github.com/posva/unplugin-vue-router
VueRouter({
Expand Down

0 comments on commit cf56ce7

Please sign in to comment.