stash
This commit is contained in:
parent
9c3fedc5c3
commit
13430c0f04
4 changed files with 11 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 4.2.7 on 2024-06-15 15:59
|
# Generated by Django 4.2.7 on 2024-06-15 17:37
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
@ -16,6 +16,7 @@ class Migration(migrations.Migration):
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||||
('code', models.CharField(max_length=255)),
|
('code', models.CharField(max_length=255)),
|
||||||
|
('type', models.CharField(max_length=255)),
|
||||||
('timestamp', models.DateTimeField(auto_now_add=True)),
|
('timestamp', models.DateTimeField(auto_now_add=True)),
|
||||||
('used_at', models.DateTimeField(null=True)),
|
('used_at', models.DateTimeField(null=True)),
|
||||||
('issue_thread', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shipping_codes', to='tickets.issuethread')),
|
('issue_thread', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shipping_codes', to='tickets.issuethread')),
|
||||||
|
|
|
@ -142,6 +142,7 @@ class ShippingCode(models.Model):
|
||||||
id = models.AutoField(primary_key=True)
|
id = models.AutoField(primary_key=True)
|
||||||
issue_thread = models.ForeignKey(IssueThread, on_delete=models.CASCADE, related_name='shipping_codes', null=True)
|
issue_thread = models.ForeignKey(IssueThread, on_delete=models.CASCADE, related_name='shipping_codes', null=True)
|
||||||
code = models.CharField(max_length=255)
|
code = models.CharField(max_length=255)
|
||||||
|
type = models.CharField(max_length=255)
|
||||||
timestamp = models.DateTimeField(auto_now_add=True)
|
timestamp = models.DateTimeField(auto_now_add=True)
|
||||||
used_at = models.DateTimeField(null=True)
|
used_at = models.DateTimeField(null=True)
|
||||||
|
|
||||||
|
|
|
@ -462,7 +462,7 @@ const store = createStore({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async createShippingCode({commit, state}, code) {
|
async createShippingCode({commit, state}, code) {
|
||||||
const {data, success} = await http.post('/2/shipping_codes/', {code}, state.user.token);
|
const {data, success} = await http.post('/2/shipping_codes/', code, state.user.token);
|
||||||
if (data && success) {
|
if (data && success) {
|
||||||
commit('setShippingCodes', data);
|
commit('setShippingCodes', data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h3>Shipping Codes</h3>
|
<h3>Shipping Codes</h3>
|
||||||
<Table
|
<ul>
|
||||||
|
<li v-for="code in shippingCodes" :key="code.code">
|
||||||
|
{{ code.type }} - {{ code.code }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!--Table
|
||||||
:columns="['type', 'code']"
|
:columns="['type', 'code']"
|
||||||
:items="shippingCodes"
|
:items="shippingCodes"
|
||||||
:keyName="'code'"
|
:keyName="'code'"
|
||||||
|
@ -18,7 +23,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table-->
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<textarea class="form-control mb-3" rows="5" placeholder="Shipping Code List" v-model="bulk_codes" v-if="bulk"></textarea>
|
<textarea class="form-control mb-3" rows="5" placeholder="Shipping Code List" v-model="bulk_codes" v-if="bulk"></textarea>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|
Loading…
Reference in a new issue